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_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>
33 #define EX_SHOW_ONLINE_LAYOUT 0x01
35 #define EX_SHOW_BUSINESS_CARDS 0x02
36 //don't modify page size
37 #define EX_SHOW_DEFAULT_PAGE 0x04
38 //replace sample toc strings in the template to localized versions
39 #define EX_LOCALIZE_TOC_STRINGS 0x08
43 class SW_DLLPUBLIC SwOneExampleFrame final
: public weld::CustomWidgetController
45 ScopedVclPtr
<VirtualDevice
> m_xVirDev
;
46 css::uno::Reference
< css::frame::XModel
> m_xModel
;
47 css::uno::Reference
< css::frame::XController
> m_xController
;
48 css::uno::Reference
< css::text::XTextCursor
> m_xCursor
;
51 Link
<SwOneExampleFrame
&,void> m_aInitializedLink
;
53 OUString m_sArgumentURL
;
55 SwView
* m_pModuleView
;
57 sal_uInt32 m_nStyleFlags
;
59 bool m_bIsInitialized
;
61 DECL_DLLPRIVATE_LINK( TimeoutHdl
, Timer
*, void );
62 void PopupHdl(std::u16string_view rId
);
64 SAL_DLLPRIVATE
void CreateControl();
65 SAL_DLLPRIVATE
void DisposeControl();
68 SwOneExampleFrame(sal_uInt32 nStyleFlags
,
69 const Link
<SwOneExampleFrame
&,void>* pInitializedLink
,
70 const OUString
* pURL
= nullptr);
71 virtual void SetDrawingArea(weld::DrawingArea
* pDrawingArea
) override
;
72 virtual void Paint(vcl::RenderContext
& rRenderContext
, const tools::Rectangle
& rRect
) override
;
73 virtual bool Command(const CommandEvent
& rCEvt
) override
;
74 virtual ~SwOneExampleFrame() override
;
76 css::uno::Reference
< css::frame::XModel
> & GetModel() {return m_xModel
;}
77 css::uno::Reference
< css::text::XTextCursor
> & GetTextCursor() {return m_xCursor
;}
81 bool IsInitialized() const {return m_bIsInitialized
;}
83 bool CreatePopup(const Point
& rPt
);
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */