Revert "tdf#158280 Replace usage of InputDialog with SvxNameDialog"
[LibreOffice.git] / sw / source / uibase / inc / unotools.hxx
blob6bc64fb1adc75b91bcc2e22d8d464788a03159d1
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_SW_SOURCE_UIBASE_INC_UNOTOOLS_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_UNOTOOLS_HXX
22 #include <sal/config.h>
24 #include <string_view>
26 #include <vcl/idle.hxx>
27 #include <vcl/weld.hxx>
28 #include <vcl/customweld.hxx>
29 #include <com/sun/star/frame/XController.hpp>
30 #include <com/sun/star/text/XTextCursor.hpp>
31 #include <swdllapi.h>
32 #include <rtl/ref.hxx>
34 #define EX_SHOW_ONLINE_LAYOUT 0x01
35 // hard zoom value
36 #define EX_SHOW_BUSINESS_CARDS 0x02
37 //don't modify page size
38 #define EX_SHOW_DEFAULT_PAGE 0x04
39 //replace sample toc strings in the template to localized versions
40 #define EX_LOCALIZE_TOC_STRINGS 0x08
42 class SwView;
43 class SwXTextCursor;
44 class SwXTextDocument;
46 class SW_DLLPUBLIC SwOneExampleFrame final : public weld::CustomWidgetController
48 ScopedVclPtr<VirtualDevice> m_xVirDev;
49 rtl::Reference< SwXTextDocument > m_xModel;
50 css::uno::Reference< css::frame::XController > m_xController;
51 rtl::Reference< SwXTextCursor > m_xCursor;
53 Idle m_aLoadedIdle;
54 Link<SwOneExampleFrame&,void> m_aInitializedLink;
56 OUString m_sArgumentURL;
58 SwView* m_pModuleView;
60 sal_uInt32 m_nStyleFlags;
62 bool m_bIsInitialized;
64 DECL_DLLPRIVATE_LINK( TimeoutHdl, Timer*, void );
65 void PopupHdl(std::u16string_view rId);
67 SAL_DLLPRIVATE void CreateControl();
68 SAL_DLLPRIVATE void DisposeControl();
70 public:
71 SwOneExampleFrame(sal_uInt32 nStyleFlags,
72 const Link<SwOneExampleFrame&,void>* pInitializedLink,
73 const OUString* pURL = nullptr);
74 virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
75 virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
76 virtual bool Command(const CommandEvent& rCEvt) override;
77 virtual ~SwOneExampleFrame() override;
79 rtl::Reference< SwXTextDocument > & GetModel() {return m_xModel;}
80 rtl::Reference< SwXTextCursor > & GetTextCursor() {return m_xCursor;}
82 void ClearDocument();
84 bool IsInitialized() const {return m_bIsInitialized;}
86 bool CreatePopup(const Point& rPt);
89 #endif
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */