LibreOffice Module sw (master)  1
htmlfly.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_SW_SOURCE_FILTER_HTML_HTMLFLY_HXX
21 #define INCLUDED_SW_SOURCE_FILTER_HTML_HTMLFLY_HXX
22 
23 #include <o3tl/sorted_vector.hxx>
24 #include <o3tl/typed_flags_set.hxx>
25 #include <sal/types.h>
26 #include <memory>
27 
28 class SdrObject;
29 class SwFrameFormat;
30 class SwNodeIndex;
31 class SwPosFlyFrame;
32 
33 // ATTENTION: The values of this enum are used directly in the output table!!!
35 {
50 };
51 
52 enum class HtmlOut {
53  TableNode,
55  OleNode,
56  Div,
57  MultiCol,
58  Spacer,
59  Control,
60  AMarquee,
61  Marquee,
63  OleGraphic,
64  Span
65 };
66 
67 enum class HtmlPosition {
68  Prefix,
69  Before,
70  Inside,
71  Any
72 };
73 
74 enum class HtmlContainerFlags {
75  NONE = 0x00,
76  Span = 0x01,
77  Div = 0x02,
78 };
79 namespace o3tl {
80  template<> struct typed_flags<HtmlContainerFlags> : is_typed_flags<HtmlContainerFlags, 0x03> {};
81 }
82 
83 const sal_uInt16 MAX_FRMTYPES = HTML_FRMTYPE_END;
84 const sal_uInt16 MAX_BROWSERS = 4;
85 
86 struct AllHtmlFlags {
90 };
96 
98 {
99  const SwFrameFormat *m_pFrameFormat; // the frame
100  const SdrObject *m_pSdrObject; // maybe Sdr-Object
101  std::unique_ptr<SwNodeIndex> m_pNodeIdex; // Node-Index
102  sal_uInt32 m_nOrdNum; // from SwPosFlyFrame
103  sal_Int32 m_nContentIndex; // its position in content
105 
106  SwHTMLPosFlyFrame(const SwHTMLPosFlyFrame&) = delete;
108 
109 public:
110 
111  SwHTMLPosFlyFrame( const SwPosFlyFrame& rPosFly,
112  const SdrObject *pSdrObj, AllHtmlFlags nAllFlags );
113 
114  bool operator<( const SwHTMLPosFlyFrame& ) const;
115 
116  const SwFrameFormat& GetFormat() const { return *m_pFrameFormat; }
117  const SdrObject* GetSdrObject() const { return m_pSdrObject; }
118  const SwNodeIndex& GetNdIndex() const { return *m_pNodeIdex; }
119  sal_Int32 GetContentIndex() const { return m_nContentIndex; }
120  AllHtmlFlags const & GetOutMode() const { return m_nAllFlags; }
121  HtmlOut GetOutFn() const { return m_nAllFlags.nOut; }
122  HtmlPosition GetOutPos() const { return m_nAllFlags.nPosition; }
123 };
124 
126  : public o3tl::sorted_vector<std::unique_ptr<SwHTMLPosFlyFrame>,
127  o3tl::less_uniqueptr_to<SwHTMLPosFlyFrame>,
128  o3tl::find_partialorder_ptrequals>
129 {};
130 
131 #endif
132 
133 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
HtmlContainerFlags nContainer
Definition: htmlfly.hxx:89
HtmlOut nOut
Definition: htmlfly.hxx:87
sal_Int32 GetContentIndex() const
Definition: htmlfly.hxx:119
std::unique_ptr< SwNodeIndex > m_pNodeIdex
Definition: htmlfly.hxx:101
HtmlContainerFlags
Definition: htmlfly.hxx:74
AllHtmlFlags const aHTMLOutFrameParaFrameTable[MAX_FRMTYPES][MAX_BROWSERS]
Definition: htmlflyt.cxx:120
bool operator<(const SwHTMLPosFlyFrame &) const
Definition: htmlfly.cxx:66
AllHtmlFlags const aHTMLOutFrameParaPrtAreaTable[MAX_FRMTYPES][MAX_BROWSERS]
Definition: htmlflyt.cxx:217
const SwNodeIndex & GetNdIndex() const
Definition: htmlfly.hxx:118
HtmlPosition GetOutPos() const
Definition: htmlfly.hxx:122
const sal_uInt16 MAX_BROWSERS
Definition: htmlfly.hxx:84
SwHTMLPosFlyFrame(const SwHTMLPosFlyFrame &)=delete
AllHtmlFlags m_nAllFlags
Definition: htmlfly.hxx:104
const SwFrameFormat & GetFormat() const
Definition: htmlfly.hxx:116
Style of a layout element.
Definition: frmfmt.hxx:59
const SwFrameFormat * m_pFrameFormat
Definition: htmlfly.hxx:99
HtmlOut GetOutFn() const
Definition: htmlfly.hxx:121
AllHtmlFlags const aHTMLOutFramePageFlyTable[MAX_FRMTYPES][MAX_BROWSERS]
Definition: htmlflyt.cxx:24
Marks a node in the document model.
Definition: ndindex.hxx:32
AllHtmlFlags const & GetOutMode() const
Definition: htmlfly.hxx:120
SwHTMLFrameType
Definition: htmlfly.hxx:34
const SdrObject * m_pSdrObject
Definition: htmlfly.hxx:100
SwHTMLPosFlyFrame & operator=(const SwHTMLPosFlyFrame &)=delete
AllHtmlFlags const aHTMLOutFrameParaOtherTable[MAX_FRMTYPES][MAX_BROWSERS]
Definition: htmlflyt.cxx:313
const SdrObject * GetSdrObject() const
Definition: htmlfly.hxx:117
HtmlOut
Definition: htmlfly.hxx:52
HtmlPosition
Definition: htmlfly.hxx:67
HtmlPosition nPosition
Definition: htmlfly.hxx:88
For querying current flys in document.
Definition: flypos.hxx:30
AllHtmlFlags const aHTMLOutFrameAsCharTable[MAX_FRMTYPES][MAX_BROWSERS]
Definition: htmlflyt.cxx:409
sal_Int32 m_nContentIndex
Definition: htmlfly.hxx:103
sal_uInt32 m_nOrdNum
Definition: htmlfly.hxx:102
const sal_uInt16 MAX_FRMTYPES
Definition: htmlfly.hxx:83