LibreOffice Module reportdesign (master) 1
dlgpage.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20
21#include <svx/dialogs.hrc>
22#include <sfx2/sfxdlg.hxx>
23#include <dlgpage.hxx>
24#include <svl/cjkoptions.hxx>
25#include <osl/diagnose.h>
26
27namespace rptui
28{
29/*************************************************************************
30|*
31|* constructor of the tab dialogs: Add the page to the dialog
32|*
33\************************************************************************/
34
35ORptPageDialog::ORptPageDialog(weld::Window* pParent, const SfxItemSet* pAttr, const OUString &rDialog)
36 : SfxTabDialogController(pParent, "modules/dbreport/ui/" +
37 rDialog.toAsciiLowerCase() + ".ui", rDialog, pAttr)
38{
40
41 if (rDialog == "BackgroundDialog")
42 {
43 AddTabPage("background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BKG ), nullptr );
44 }
45 else if (rDialog == "PageDialog")
46 {
47 AddTabPage("page", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE ), nullptr );
48 AddTabPage("background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BKG ), nullptr );
49 }
50 else if (rDialog == "CharDialog")
51 {
52 AddTabPage("font", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), nullptr );
53 AddTabPage("fonteffects", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), nullptr );
54 AddTabPage("position", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), nullptr );
55 AddTabPage("asianlayout", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), nullptr );
56 AddTabPage("background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BKG ), nullptr );
57 AddTabPage("alignment", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_ALIGNMENT ), nullptr );
58 }
59 else
60 OSL_FAIL("Unknown page id");
61
63 RemoveTabPage("asianlayout");
64}
65
66void ORptPageDialog::PageCreated(const OUString& rId, SfxTabPage &rPage)
67{
68 SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
69 if (rId == "background")
70 {
71 rPage.PageCreated(aSet);
72 }
73}
74
75} // namespace rptui
76
77
78/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static SfxAbstractDialogFactory * Create()
virtual CreateTabPage GetTabPageCreatorFunc(sal_uInt16 nId)=0
void AddTabPage(const OUString &rName, CreateTabPage pCreateFunc, GetTabPageRanges pRangesFunc)
void RemoveTabPage(const OUString &rName)
SfxItemSet * GetInputSetImpl()
virtual void PageCreated(const SfxAllItemSet &aSet)
ORptPageDialog(const ORptPageDialog &)=delete
virtual void PageCreated(const OUString &rId, SfxTabPage &rPage) override
Definition: dlgpage.cxx:66
bool IsDoubleLinesEnabled()