Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sw / source / filter / html / htmlfly.hxx
blobf6265f5325264e6f60c926a86c86dac508a5e489
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 .
20 #pragma once
22 #include <o3tl/sorted_vector.hxx>
23 #include <o3tl/typed_flags_set.hxx>
24 #include <sal/types.h>
25 #include <ndindex.hxx>
26 #include <memory>
28 class SdrObject;
29 class SwFrameFormat;
30 class SwPosFlyFrame;
32 // ATTENTION: The values of this enum are used directly in the output table!!!
33 enum SwHTMLFrameType
35 HTML_FRMTYPE_TABLE,
36 HTML_FRMTYPE_TABLE_CAP,
37 HTML_FRMTYPE_MULTICOL,
38 HTML_FRMTYPE_EMPTY,
39 HTML_FRMTYPE_TEXT,
40 HTML_FRMTYPE_GRF,
41 HTML_FRMTYPE_PLUGIN,
42 HTML_FRMTYPE_APPLET,
43 HTML_FRMTYPE_IFRAME,
44 HTML_FRMTYPE_OLE,
45 HTML_FRMTYPE_MARQUEE,
46 HTML_FRMTYPE_CONTROL,
47 HTML_FRMTYPE_DRAW,
48 HTML_FRMTYPE_END
51 enum class HtmlOut {
52 TableNode,
53 GraphicNode,
54 OleNode,
55 Div,
56 MultiCol,
57 Spacer,
58 Control,
59 AMarquee,
60 Marquee,
61 GraphicFrame,
62 OleGraphic,
63 Span
66 enum class HtmlPosition {
67 Prefix,
68 Before,
69 Inside,
70 Any
73 enum class HtmlContainerFlags {
74 NONE = 0x00,
75 Span = 0x01,
76 Div = 0x02,
78 namespace o3tl {
79 template<> struct typed_flags<HtmlContainerFlags> : is_typed_flags<HtmlContainerFlags, 0x03> {};
82 const sal_uInt16 MAX_FRMTYPES = HTML_FRMTYPE_END;
83 const sal_uInt16 MAX_BROWSERS = 4;
85 struct AllHtmlFlags {
86 HtmlOut nOut;
87 HtmlPosition nPosition;
88 HtmlContainerFlags nContainer;
90 extern AllHtmlFlags const aHTMLOutFramePageFlyTable[MAX_FRMTYPES][MAX_BROWSERS];
91 extern AllHtmlFlags const aHTMLOutFrameParaFrameTable[MAX_FRMTYPES][MAX_BROWSERS];
92 extern AllHtmlFlags const aHTMLOutFrameParaPrtAreaTable[MAX_FRMTYPES][MAX_BROWSERS];
93 extern AllHtmlFlags const aHTMLOutFrameParaOtherTable[MAX_FRMTYPES][MAX_BROWSERS];
94 extern AllHtmlFlags const aHTMLOutFrameAsCharTable[MAX_FRMTYPES][MAX_BROWSERS];
96 class SwHTMLPosFlyFrame
98 const SwFrameFormat *m_pFrameFormat; // the frame
99 const SdrObject *m_pSdrObject; // maybe Sdr-Object
100 SwNodeIndex m_aNodeIndex; // Node-Index
101 sal_uInt32 m_nOrdNum; // from SwPosFlyFrame
102 sal_Int32 m_nContentIndex; // its position in content
103 AllHtmlFlags m_nAllFlags;
105 SwHTMLPosFlyFrame(const SwHTMLPosFlyFrame&) = delete;
106 SwHTMLPosFlyFrame& operator=(const SwHTMLPosFlyFrame&) = delete;
108 public:
110 SwHTMLPosFlyFrame( const SwPosFlyFrame& rPosFly,
111 const SdrObject *pSdrObj, AllHtmlFlags nAllFlags );
113 bool operator<( const SwHTMLPosFlyFrame& ) const;
115 const SwFrameFormat& GetFormat() const { return *m_pFrameFormat; }
116 const SdrObject* GetSdrObject() const { return m_pSdrObject; }
117 const SwNodeIndex& GetNdIndex() const { return m_aNodeIndex; }
118 sal_Int32 GetContentIndex() const { return m_nContentIndex; }
119 AllHtmlFlags const & GetOutMode() const { return m_nAllFlags; }
120 HtmlOut GetOutFn() const { return m_nAllFlags.nOut; }
121 HtmlPosition GetOutPos() const { return m_nAllFlags.nPosition; }
124 class SwHTMLPosFlyFrames
125 : public o3tl::sorted_vector<std::unique_ptr<SwHTMLPosFlyFrame>,
126 o3tl::less_uniqueptr_to<SwHTMLPosFlyFrame>,
127 o3tl::find_partialorder_ptrequals>
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */