25#include <osl/diagnose.h>
59#include <svx/dialogs.hrc>
66 const OUString& sPage,
70 "modules/swriter/ui/templatedialog" +
71 OUString::number(static_cast<sal_uInt16>(nRegion)) +
".ui",
72 "TemplateDialog" + OUString::number(static_cast<sal_uInt16>(nRegion)),
75 , m_pWrtShell(pActShell)
97 case SfxStyleFamily::Char:
110 case SfxStyleFamily::Para:
171 case SfxStyleFamily::Page:
198 case SfxStyleFamily::Pseudo:
200 AddTabPage(
"numbering", RID_SVXPAGE_PICK_SINGLE_NUM);
201 AddTabPage(
"bullets", RID_SVXPAGE_PICK_BULLET);
204 AddTabPage(
"customize", RID_SVXPAGE_NUM_OPTIONS );
205 AddTabPage(
"position", RID_SVXPAGE_NUM_POSITION );
208 case SfxStyleFamily::Frame:
226 OSL_ENSURE(
false,
"wrong family");
231 else if (!sPage.isEmpty())
242 SID_ATTR_NUMBERING_RULE,
false, &pExItem ) &&
245 SID_ATTR_NUMBERING_RULE,
false, &pOutItem ) ||
246 *pExItem != *pOutItem ))
273 OUString sNumCharFormat, sBulletCharFormat;
283 GetDocShell()->
GetItem( SID_ATTR_CHAR_FONTLIST ) ) );
286 sal_uInt32 nFlags = 0;
289 if( SfxStyleFamily::Char ==
m_nType )
295 else if (rId ==
"fonteffect")
298 if( SfxStyleFamily::Char ==
m_nType )
303 else if (rId ==
"position")
305 if( SfxStyleFamily::Char ==
m_nType )
310 else if (SfxStyleFamily::Pseudo ==
m_nType)
317 aSet.
Put (
SfxUInt16Item(SID_METRIC_ITEM,
static_cast< sal_uInt16
>(eMetric)));
322 else if (rId ==
"columns")
324 if(
m_nType == SfxStyleFamily::Frame )
326 static_cast<SwColumnPage&
>(rPage).SetFormatUsed(
true );
330 else if (rId ==
"background" || rId ==
"highlighting")
333 if( SfxStyleFamily::Char ==
m_nType || SfxStyleFamily::Para ==
m_nType )
334 nFlagType |= SvxBackgroundTabFlags::SHOW_HIGHLIGHTING;
335 aSet.
Put (
SfxUInt32Item(SID_FLAG_TYPE,
static_cast<sal_uInt32
>(nFlagType)));
338 else if (rId ==
"condition")
343 else if (rId ==
"page")
347 std::vector<OUString> aList;
350 aList.push_back( aNew );
354 GetView().GetDocShell()->GetStyleSheetPool();
358 aList.push_back( pFirstStyle->
GetName() );
359 pFirstStyle = pStyleSheetPool->
Next();
368 else if (rId ==
"header")
379 else if (rId ==
"footer")
390 else if (rId ==
"border")
392 if( SfxStyleFamily::Para ==
m_nType )
394 aSet.
Put (
SfxUInt16Item(SID_SWMODE_TYPE,
static_cast<sal_uInt16
>(SwBorderModes::PARA)));
396 else if( SfxStyleFamily::Frame ==
m_nType )
398 aSet.
Put (
SfxUInt16Item(SID_SWMODE_TYPE,
static_cast<sal_uInt16
>(SwBorderModes::FRAME)));
402 else if (rId ==
"borders")
404 if( SfxStyleFamily::Para ==
m_nType )
406 aSet.
Put (
SfxUInt16Item(SID_SWMODE_TYPE,
static_cast<sal_uInt16
>(SwBorderModes::PARA)));
408 else if( SfxStyleFamily::Frame ==
m_nType )
410 aSet.
Put (
SfxUInt16Item(SID_SWMODE_TYPE,
static_cast<sal_uInt16
>(SwBorderModes::FRAME)));
420 else if (rId ==
"area")
429 else if (rId ==
"transparence")
433 else if (rId ==
"bullets")
438 else if (rId ==
"outline")
440 if (SfxStyleFamily::Pseudo ==
m_nType)
446 else if (SfxStyleFamily::Para ==
m_nType)
458 std::set<OUString> aNames;
461 aNames.insert(pBase->
GetName());
462 pBase = pPool->
Next();
464 aNames.erase(
SwResId(STR_POOLNUMRULE_NOLIST));
465 for(std::set<OUString>::const_iterator it = aNames.begin(); it != aNames.end(); ++it)
469 else if (rId ==
"customize")
476 std::unique_ptr<weld::ComboBox> xCharFormatLB(xBuilder->weld_combo_box(
"combobox"));
477 xCharFormatLB->clear();
484 std::vector<OUString> aList;
485 aList.reserve(xCharFormatLB->get_count());
486 for (sal_Int32 j = 0; j < xCharFormatLB->get_count(); j++)
487 aList.push_back(xCharFormatLB->get_text(j));
491 aSet.
Put (
SfxUInt16Item(SID_METRIC_ITEM,
static_cast< sal_uInt16
>(eMetric)));
495 else if (rId ==
"indents")
500 aSet.
Put(
SfxUInt32Item(SID_SVXSTDPARAGRAPHTABPAGE_ABSLINEDIST, constTwips_0_5mm));
505 else if (rId ==
"alignment")
507 aSet.
Put(
SfxBoolItem(SID_SVXPARAALIGNTABPAGE_ENABLEJUSTIFYEXT,
true));
510 else if (rId ==
"asianlayout")
512 if( SfxStyleFamily::Char ==
m_nType )
518 else if (rId ==
"type")
520 static_cast<SwFramePage&
>(rPage).SetNewFrame(
true );
521 static_cast<SwFramePage&
>(rPage).SetFormatUsed(
true );
523 else if (rId ==
"options")
528 else if (rId ==
"wrap")
530 static_cast<SwWrapTabPage&
>(rPage).SetFormatUsed(
true,
false );
532 else if (rId ==
"macros")
static std::unique_ptr< weld::Builder > CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false, sal_uInt64 nLOKWindowId=0)
virtual GetTabPageRanges GetTabPageRangesFunc(sal_uInt16 nId)=0
static SfxAbstractDialogFactory * Create()
virtual CreateTabPage GetTabPageCreatorFunc(sal_uInt16 nId)=0
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
SfxItemPool * GetPool() const
void SetParent(const SfxItemSet *pNew)
const SfxItemSet * GetParent() const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SfxStyleSheetBase & GetStyleSheet()
SfxStyleSheetBase * First(SfxStyleFamily eFamily, SfxStyleSearchBits eMask=SfxStyleSearchBits::All)
SfxStyleSheetBase * Next()
const OUString & GetName() const
virtual SfxItemSet & GetItemSet()
void SetCurPageId(const OUString &rName)
void AddTabPage(const OUString &rName, CreateTabPage pCreateFunc, GetTabPageRanges pRangesFunc)
void RemoveTabPage(const OUString &rName)
std::unique_ptr< SfxItemSet > m_xExampleSet
weld::Button * GetResetButton() const
const SfxItemSet * GetOutputItemSet() const
weld::Button * GetStandardButton() const
SfxItemSet * GetInputSetImpl()
weld::Button * GetApplyButton() const
virtual void PageCreated(const SfxAllItemSet &aSet)
const SfxItemSet & GetItemSet() const
void SetFrame(const css::uno::Reference< css::frame::XFrame > &xFrame)
SfxFrame & GetFrame() const
SfxViewFrame & GetViewFrame() const
const FontList * GetFontList() const
static WhichRangesContainer GetRanges()
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
The Condition tab on the paragraph style dialog for conditional styles, e.g. Text Body.
static WhichRangesContainer GetRanges()
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
const SwView * GetView() const
virtual SfxStyleSheetBasePool * GetStyleSheetPool() override
For Style PI.
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
static WhichRangesContainer GetRanges()
SwTextFormatColl * FindTextFormatCollByName(const OUString &rName) const
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
static WhichRangesContainer GetRanges()
This is the Position & Size tab page of the Insert -> Frame -> Frame dialog.
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
static WhichRangesContainer GetRanges()
static SfxEventNamesItem AddEvents(DlgEventType eType)
static WhichRangesContainer GetRanges()
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
static void FillUIName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
SwTemplateDlgController(weld::Window *pParent, SfxStyleSheetBase &rBase, SfxStyleFamily nRegion, const OUString &sPage, SwWrtShell *pActShell, bool bNew)
virtual void PageCreated(const OUString &rId, SfxTabPage &rPage) override
virtual void RefreshInputSet() override
virtual short Ok() override
Represents the style of a paragraph.
bool IsAssignedToListLevelOfOutlineStyle() const
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
static WhichRangesContainer GetRanges()
static ShellResource * GetShellRes()
SwDocShell * GetDocShell()
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
static WhichRangesContainer GetRanges()
Used by the UI to modify the document model.
const SwView & GetView() const
void append_text(const OUString &rStr)
#define SVX_RELATIVE_MODE
#define SVX_ENABLE_CHAR_TRANSPARENCY
#define SVX_PREVIEW_CHARACTER
constexpr TypedWhichId< SwConditionTextFormatColl > RES_CONDTXTFMTCOLL(166)
bool IsDoubleLinesEnabled()
bool IsAsianTypographyEnabled()
bool IsPrintLayoutExtension()
constexpr auto toTwips(N number, Length from)
@ RES_POOLCOLL_TEXT
Text body.
@ RES_POOLCHR_BULLET_LEVEL
Bullets.
@ RES_POOLCHR_NUM_LEVEL
Numbering symbols.
SwWrtShell * GetActiveWrtShell()
OUString SwResId(TranslateId aId)
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)