57 #include <svx/dialogs.hrc>
68 "modules/swriter/ui/templatedialog" +
69 OUString::number(static_cast<sal_uInt16>(nRegion)) +
".ui",
70 "TemplateDialog" + OString::number(static_cast<sal_uInt16>(nRegion)),
73 , pWrtShell(pActShell)
82 case SfxStyleFamily::Char:
84 AddTabPage(
"font", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ));
85 AddTabPage(
"fonteffect", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ));
86 AddTabPage(
"position", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_POSITION ));
87 AddTabPage(
"asianlayout", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_TWOLINES ));
88 AddTabPage(
"background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BKG ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BKG ));
89 AddTabPage(
"borders", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ));
96 case SfxStyleFamily::Para:
98 AddTabPage(
"indents", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_STD_PARAGRAPH), pFact->GetTabPageRangesFunc(RID_SVXPAGE_STD_PARAGRAPH));
100 AddTabPage(
"alignment", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), pFact->GetTabPageRangesFunc(RID_SVXPAGE_ALIGN_PARAGRAPH));
102 AddTabPage(
"textflow", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_EXT_PARAGRAPH), pFact->GetTabPageRangesFunc(RID_SVXPAGE_EXT_PARAGRAPH) );
104 AddTabPage(
"asiantypo", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), pFact->GetTabPageRangesFunc(RID_SVXPAGE_PARA_ASIAN) );
106 AddTabPage(
"font", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ) );
108 AddTabPage(
"fonteffect", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ) );
110 AddTabPage(
"position", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_POSITION ) );
112 AddTabPage(
"asianlayout", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_TWOLINES ) );
114 AddTabPage(
"highlighting", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BKG ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BKG ));
116 AddTabPage(
"tabs", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_TABULATOR), pFact->GetTabPageRangesFunc(RID_SVXPAGE_TABULATOR) );
122 AddTabPage(
"area", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_AREA ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_AREA ));
123 AddTabPage(
"transparence", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_TRANSPARENCE ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_TRANSPARENCE ) );
125 AddTabPage(
"borders", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
159 case SfxStyleFamily::Page:
162 AddTabPage(
"area", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_AREA ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_AREA ));
163 AddTabPage(
"transparence", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_TRANSPARENCE ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_TRANSPARENCE ) );
166 AddTabPage(
"page", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PAGE), pFact->GetTabPageRangesFunc(RID_SVXPAGE_PAGE));
169 AddTabPage(
"borders", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
187 case SfxStyleFamily::Pseudo:
189 AddTabPage(
"numbering", RID_SVXPAGE_PICK_SINGLE_NUM);
190 AddTabPage(
"bullets", RID_SVXPAGE_PICK_BULLET);
193 AddTabPage(
"customize", RID_SVXPAGE_NUM_OPTIONS );
194 AddTabPage(
"position", RID_SVXPAGE_NUM_POSITION );
197 case SfxStyleFamily::Frame:
204 AddTabPage(
"area", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_AREA ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_AREA ));
205 AddTabPage(
"transparence", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_TRANSPARENCE ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_TRANSPARENCE ) );
207 AddTabPage(
"borders", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
211 AddTabPage(
"macros", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_MACROASSIGN),
nullptr);
215 OSL_ENSURE(
false,
"wrong family");
220 else if (!sPage.isEmpty())
231 SID_ATTR_NUMBERING_RULE,
false, &pExItem ) &&
234 SID_ATTR_NUMBERING_RULE,
false, &pOutItem ) ||
235 *pExItem != *pOutItem ))
262 OUString sNumCharFormat, sBulletCharFormat;
272 GetDocShell()->
GetItem( SID_ATTR_CHAR_FONTLIST ) ) );
275 sal_uInt32 nFlags = 0;
278 if( SfxStyleFamily::Char ==
nType )
283 else if (rId ==
"fonteffect")
286 if( SfxStyleFamily::Char ==
nType )
291 else if (rId ==
"position")
293 if( SfxStyleFamily::Char ==
nType )
298 else if (SfxStyleFamily::Pseudo ==
nType)
303 aSet.
Put (
SfxUInt16Item(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric)));
307 else if (rId ==
"columns")
309 if(
nType == SfxStyleFamily::Frame )
311 static_cast<SwColumnPage&
>(rPage).SetFormatUsed(
true );
315 else if (rId ==
"background" || rId ==
"highlighting")
318 if( SfxStyleFamily::Char ==
nType || SfxStyleFamily::Para ==
nType )
319 nFlagType |= SvxBackgroundTabFlags::SHOW_HIGHLIGHTING;
320 aSet.
Put (
SfxUInt32Item(SID_FLAG_TYPE, static_cast<sal_uInt32>(nFlagType)));
323 else if (rId ==
"condition")
326 static_cast<SwDocStyleSheet&>(
GetStyleSheet()).GetCollection() );
328 else if (rId ==
"page")
332 std::vector<OUString> aList;
335 aList.push_back( aNew );
339 GetView().GetDocShell()->GetStyleSheetPool();
343 aList.push_back( pFirstStyle->
GetName() );
344 pFirstStyle = pStyleSheetPool->
Next();
353 else if (rId ==
"header")
364 else if (rId ==
"footer")
375 else if (rId ==
"border")
377 if( SfxStyleFamily::Para ==
nType )
379 aSet.
Put (
SfxUInt16Item(SID_SWMODE_TYPE,static_cast<sal_uInt16>(SwBorderModes::PARA)));
381 else if( SfxStyleFamily::Frame ==
nType )
383 aSet.
Put (
SfxUInt16Item(SID_SWMODE_TYPE,static_cast<sal_uInt16>(SwBorderModes::FRAME)));
387 else if (rId ==
"borders")
389 if( SfxStyleFamily::Para ==
nType )
391 aSet.
Put (
SfxUInt16Item(SID_SWMODE_TYPE,static_cast<sal_uInt16>(SwBorderModes::PARA)));
393 else if( SfxStyleFamily::Frame ==
nType )
395 aSet.
Put (
SfxUInt16Item(SID_SWMODE_TYPE,static_cast<sal_uInt16>(SwBorderModes::FRAME)));
405 else if (rId ==
"area")
414 else if (rId ==
"transparence")
418 else if (rId ==
"bullets")
423 else if (rId ==
"outline")
425 if (SfxStyleFamily::Pseudo ==
nType)
431 else if (SfxStyleFamily::Para ==
nType)
443 std::set<OUString> aNames;
446 aNames.insert(pBase->
GetName());
447 pBase = pPool->
Next();
449 for(std::set<OUString>::const_iterator it = aNames.begin(); it != aNames.end(); ++it)
453 else if (rId ==
"customize")
460 std::unique_ptr<weld::ComboBox> xCharFormatLB(xBuilder->weld_combo_box(
"combobox"));
461 xCharFormatLB->clear();
466 std::vector<OUString> aList;
467 aList.reserve(xCharFormatLB->get_count());
468 for (sal_Int32 j = 0; j < xCharFormatLB->get_count(); j++)
469 aList.push_back(xCharFormatLB->get_text(j));
473 aSet.
Put (
SfxUInt16Item(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric)));
476 else if (rId ==
"indents")
485 else if (rId ==
"alignment")
487 aSet.
Put(
SfxBoolItem(SID_SVXPARAALIGNTABPAGE_ENABLEJUSTIFYEXT,
true));
490 else if (rId ==
"asianlayout")
492 if( SfxStyleFamily::Char ==
nType )
498 else if (rId ==
"type")
500 static_cast<SwFramePage&
>(rPage).SetNewFrame(
true );
501 static_cast<SwFramePage&
>(rPage).SetFormatUsed(
true );
503 else if (rId ==
"options")
508 else if (rId ==
"wrap")
510 static_cast<SwWrapTabPage&
>(rPage).SetFormatUsed(
true,
false );
512 else if (rId ==
"macros")
SfxViewFrame * GetViewFrame() const
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
SfxStyleSheetBase * First(SfxStyleFamily eFamily, SfxStyleSearchBits eMask=SfxStyleSearchBits::All)
bool IsPrintLayoutExtension() const
SwTextFormatColl * FindTextFormatCollByName(std::u16string_view rName) const
Represents the style of a paragraph.
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
virtual void PageCreated(const SfxAllItemSet &aSet)
static SfxAbstractDialogFactory * Create()
static ShellResource * GetShellRes()
const SfxItemSet * GetOutputItemSet() const
static void FillUIName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
SwWrtShell * GetActiveWrtShell()
std::unique_ptr< SfxItemSet > m_xExampleSet
void RemoveTabPage(const OString &rName)
static weld::Builder * CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false)
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
virtual void RefreshInputSet() override
SfxItemSet * GetInputSetImpl()
SwTemplateDlgController(weld::Window *pParent, SfxStyleSheetBase &rBase, SfxStyleFamily nRegion, const OString &sPage, SwWrtShell *pActShell, bool bNew)
Used by the UI to modify the document model.
bool IsAssignedToListLevelOfOutlineStyle() const
static const sal_uInt16 * GetRanges()
const SwView & GetView() const
const OUString & GetName() const
SfxFrame & GetFrame() const
#define SVX_PREVIEW_CHARACTER
SfxStyleSheetBase & GetStyleSheet()
void SetFrame(const css::uno::Reference< css::frame::XFrame > &xFrame)
static SfxEventNamesItem AddEvents(DlgEventType eType)
static const sal_uInt16 * GetRanges()
static const sal_uInt16 * GetRanges()
const SfxItemSet & GetItemSet() const
static SvxHtmlOptions & Get()
static const sal_uInt16 * GetRanges()
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
const SfxItemSet * GetParent() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
bool IsDoubleLinesEnabled() const
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
virtual SfxStyleSheetBasePool * GetStyleSheetPool() override
For Style PI.
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
static const sal_uInt16 * GetRanges()
SfxItemPool * GetPool() const
virtual void PageCreated(const OString &rId, SfxTabPage &rPage) override
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
SwDocShell * GetDocShell()
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
void SetParent(const SfxItemSet *pNew)
virtual short Ok() override
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
bool IsAsianTypographyEnabled() const
SfxStyleSheetBase * Next()
void AddTabPage(const OString &rName, CreateTabPage pCreateFunc, GetTabPageRanges pRangesFunc)
static const sal_uInt16 * GetRanges()
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
constexpr TypedWhichId< SwConditionTextFormatColl > RES_CONDTXTFMTCOLL(158)
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
void append_text(const OUString &rStr)
const FontList * GetFontList() const
#define SVX_ENABLE_CHAR_TRANSPARENCY
#define SVX_RELATIVE_MODE
static const sal_uInt16 * GetRanges()
void SetCurPageId(const OString &rName)
static const sal_uInt16 * GetRanges()