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 
27 namespace rptui
28 {
29 /*************************************************************************
30 |*
31 |* constructor of the tab dialogs: Add the page to the dialog
32 |*
33 \************************************************************************/
34 
35 ORptPageDialog::ORptPageDialog(weld::Window* pParent, const SfxItemSet* pAttr, const OUString &rDialog)
36  : SfxTabDialogController(pParent, "modules/dbreport/ui/" +
37  rDialog.toAsciiLowerCase() + ".ui", rDialog.toUtf8(), 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 
62  SvtCJKOptions aCJKOptions;
63  if ( !aCJKOptions.IsDoubleLinesEnabled() )
64  RemoveTabPage("asianlayout");
65 }
66 
67 void ORptPageDialog::PageCreated(const OString& rId, SfxTabPage &rPage)
68 {
69  SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
70  if (rId == "background")
71  {
72  rPage.PageCreated(aSet);
73  }
74 }
75 
76 } // namespace rptui
77 
78 
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ORptPageDialog(const ORptPageDialog &)=delete
virtual void PageCreated(const SfxAllItemSet &aSet)
static SfxAbstractDialogFactory * Create()
void RemoveTabPage(const OString &rName)
SfxItemSet * GetInputSetImpl()
virtual CreateTabPage GetTabPageCreatorFunc(sal_uInt16 nId)=0
bool IsDoubleLinesEnabled() const
virtual void PageCreated(const OString &rId, SfxTabPage &rPage) override
Definition: dlgpage.cxx:67
void AddTabPage(const OString &rName, CreateTabPage pCreateFunc, GetTabPageRanges pRangesFunc)