Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / include / sfx2 / basedlgs.hxx
blob55550b74ac5ee192f4f9b1c7a7fec40a4adb5271
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
30 class TabPage;
31 class SfxTabPage;
32 class SfxBindings;
33 class SfxChildWindow;
34 struct SfxChildWinInfo;
35 class SfxItemSet;
36 class SfxItemPool;
37 class OKButton;
38 class CancelButton;
39 class HelpButton;
40 class Button;
41 class FixedLine;
43 // class SfxModalDialog --------------------------------------------------
45 class SFX2_DLLPUBLIC SfxModalDialog: public ModalDialog
47 sal_uInt32 nUniqId;
48 OUString aExtraData;
49 const SfxItemSet* pInputSet;
50 SfxItemSet* pOutputSet;
52 private:
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();
60 protected:
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; }
72 public:
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;
84 Size aSize;
85 std::unique_ptr< SfxModelessDialog_Impl > pImpl;
87 SfxModelessDialog(SfxModelessDialog &) = delete;
88 void operator =(SfxModelessDialog &) = delete;
90 void Init(SfxBindings *pBindinx, SfxChildWindow *pCW);
92 protected:
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;
102 public:
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;
118 Size aSize;
119 std::unique_ptr< SfxFloatingWindow_Impl > pImpl;
121 SfxFloatingWindow(SfxFloatingWindow &) = delete;
122 void operator =(SfxFloatingWindow &) = delete;
124 protected:
125 SfxFloatingWindow( SfxBindings *pBindings,
126 SfxChildWindow *pCW,
127 vcl::Window* pParent,
128 WinBits nWinBits=WB_STDMODELESS);
129 SfxFloatingWindow( SfxBindings *pBindings,
130 SfxChildWindow *pCW,
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; }
145 public:
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;
160 SingleTabDlgImpl();
163 typedef const sal_uInt16* (*GetTabPageRanges)(); // liefert internationale Which-Werte
165 class SFX2_DLLPUBLIC SfxSingleTabDialog : public SfxModalDialog
167 public:
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; }
184 protected:
185 GetTabPageRanges fnGetRanges;
187 VclPtr<OKButton> pOKBtn;
188 VclPtr<CancelButton> pCancelBtn;
189 VclPtr<HelpButton> pHelpBtn;
191 DECL_DLLPRIVATE_LINK_TYPED(OKHdl_Impl, Button*, void);
193 private:
194 std::unique_ptr<SingleTabDlgImpl> pImpl;
197 #endif
199 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */