1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SFX2_BASEDLGS_HXX
20 #define INCLUDED_SFX2_BASEDLGS_HXX
22 #include <sal/config.h>
23 #include <sfx2/dllapi.h>
24 #include <sal/types.h>
25 #include <vcl/builder.hxx>
26 #include <vcl/dialog.hxx>
27 #include <vcl/floatwin.hxx>
28 #include <vcl/timer.hxx>
34 struct SfxChildWinInfo
;
43 // class SfxModalDialog --------------------------------------------------
45 class SFX2_DLLPUBLIC SfxModalDialog
: public ModalDialog
49 const SfxItemSet
* pInputSet
;
50 SfxItemSet
* pOutputSet
;
53 SfxModalDialog(SfxModalDialog
&) = delete;
54 void operator =(SfxModalDialog
&) = delete;
56 SAL_DLLPRIVATE
void SetDialogData_Impl();
57 SAL_DLLPRIVATE
void GetDialogData_Impl();
58 SAL_DLLPRIVATE
void init();
61 SfxModalDialog(vcl::Window
*pParent
, const OUString
& rID
, const OUString
& rUIXMLDescription
);
63 OUString
& GetExtraData() { return aExtraData
; }
64 sal_uInt32
GetUniqId() const { return nUniqId
; }
65 void SetUniqId(sal_uInt32 nSettingsId
) { nUniqId
= nSettingsId
; }
66 SfxItemSet
* GetItemSet() { return pOutputSet
; }
67 void CreateOutputItemSet( SfxItemPool
& rPool
);
68 void CreateOutputItemSet( const SfxItemSet
& rInput
);
69 void SetInputSet( const SfxItemSet
* pInSet
) { pInputSet
= pInSet
; }
70 SfxItemSet
* GetOutputSetImpl() { return pOutputSet
; }
73 virtual ~SfxModalDialog();
74 virtual void dispose() override
;
75 const SfxItemSet
* GetOutputItemSet() const { return pOutputSet
; }
76 const SfxItemSet
* GetInputItemSet() const { return pInputSet
; }
79 // class SfxModelessDialog --------------------------------------------------
80 class SfxModelessDialog_Impl
;
81 class SFX2_DLLPUBLIC SfxModelessDialog
: public ModelessDialog
83 SfxBindings
* pBindings
;
85 std::unique_ptr
< SfxModelessDialog_Impl
> pImpl
;
87 SfxModelessDialog(SfxModelessDialog
&) = delete;
88 void operator =(SfxModelessDialog
&) = delete;
90 void Init(SfxBindings
*pBindinx
, SfxChildWindow
*pCW
);
93 SfxModelessDialog( SfxBindings
*, SfxChildWindow
*,
94 vcl::Window
*, const OUString
& rID
, const OUString
& rUIXMLDescription
);
95 virtual ~SfxModelessDialog();
96 virtual void dispose() override
;
97 virtual bool Close() override
;
98 virtual void Resize() override
;
99 virtual void Move() override
;
100 virtual void StateChanged( StateChangedType nStateChange
) override
;
103 virtual void FillInfo(SfxChildWinInfo
&) const;
104 void Initialize (SfxChildWinInfo
* pInfo
);
105 virtual bool Notify( NotifyEvent
& rNEvt
) override
;
106 SfxBindings
& GetBindings()
107 { return *pBindings
; }
109 DECL_LINK_TYPED(TimerHdl
, Idle
*, void);
113 // class SfxFloatingWindow --------------------------------------------------
114 class SfxFloatingWindow_Impl
;
115 class SFX2_DLLPUBLIC SfxFloatingWindow
: public FloatingWindow
117 SfxBindings
* pBindings
;
119 std::unique_ptr
< SfxFloatingWindow_Impl
> pImpl
;
121 SfxFloatingWindow(SfxFloatingWindow
&) = delete;
122 void operator =(SfxFloatingWindow
&) = delete;
125 SfxFloatingWindow( SfxBindings
*pBindings
,
127 vcl::Window
* pParent
,
128 WinBits nWinBits
=WB_STDMODELESS
);
129 SfxFloatingWindow( SfxBindings
*pBindings
,
131 vcl::Window
* pParent
,
132 const OString
& rID
, const OUString
& rUIXMLDescription
,
133 const css::uno::Reference
<css::frame::XFrame
> &rFrame
= css::uno::Reference
<css::frame::XFrame
>());
134 virtual ~SfxFloatingWindow();
135 virtual void dispose() override
;
137 virtual void StateChanged( StateChangedType nStateChange
) override
;
138 virtual bool Close() override
;
139 virtual void Resize() override
;
140 virtual void Move() override
;
141 virtual bool Notify( NotifyEvent
& rNEvt
) override
;
142 SfxBindings
& GetBindings()
143 { return *pBindings
; }
146 virtual void FillInfo(SfxChildWinInfo
&) const;
147 void Initialize (SfxChildWinInfo
* pInfo
);
149 DECL_LINK_TYPED(TimerHdl
, Idle
*, void);
153 // class SfxNoLayoutSingleTabDialog --------------------------------------------------
155 struct SingleTabDlgImpl
157 VclPtr
<SfxTabPage
> m_pSfxPage
;
158 VclPtr
<FixedLine
> m_pLine
;
163 typedef const sal_uInt16
* (*GetTabPageRanges
)(); // liefert internationale Which-Werte
165 class SFX2_DLLPUBLIC SfxSingleTabDialog
: public SfxModalDialog
168 SfxSingleTabDialog(vcl::Window
*pParent
, const SfxItemSet
& rOptionsSet
,
169 const OUString
& rID
= OUString("SingleTabDialog"),
170 const OUString
& rUIXMLDescription
= OUString("sfx/ui/singletabdialog.ui"));
172 SfxSingleTabDialog(vcl::Window
*pParent
, const SfxItemSet
* pInSet
= nullptr,
173 const OUString
& rID
= OUString("SingleTabDialog"),
174 const OUString
& rUIXMLDescription
= OUString("sfx/ui/singletabdialog.ui"));
176 virtual ~SfxSingleTabDialog();
177 virtual void dispose() override
;
179 void SetTabPage(SfxTabPage
* pTabPage
, GetTabPageRanges pRangesFunc
= nullptr, sal_uInt32 nSettingsId
= 0);
180 SfxTabPage
* GetTabPage() const { return pImpl
->m_pSfxPage
; }
182 OKButton
* GetOKButton() const { return pOKBtn
; }
185 GetTabPageRanges fnGetRanges
;
187 VclPtr
<OKButton
> pOKBtn
;
188 VclPtr
<CancelButton
> pCancelBtn
;
189 VclPtr
<HelpButton
> pHelpBtn
;
191 DECL_DLLPRIVATE_LINK_TYPED(OKHdl_Impl
, Button
*, void);
194 std::unique_ptr
<SingleTabDlgImpl
> pImpl
;
199 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */