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 .
22 #include <o3tl/sorted_vector.hxx>
23 #include <o3tl/typed_flags_set.hxx>
24 #include <sal/types.h>
25 #include <ndindex.hxx>
32 // ATTENTION: The values of this enum are used directly in the output table!!!
36 HTML_FRMTYPE_TABLE_CAP
,
37 HTML_FRMTYPE_MULTICOL
,
66 enum class HtmlPosition
{
73 enum class HtmlContainerFlags
{
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;
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;
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: */