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 <ndindex.hxx>
24 
25 #include <o3tl/sorted_vector.hxx>
26 #include <o3tl/typed_flags_set.hxx>
27 #include <sal/types.h>
28 #include <memory>
29 
30 class SdrObject;
31 class SwFrameFormat;
32 class SwNodeIndex;
33 class SwPosFlyFrame;
34 
35 // ATTENTION: The values of this enum are used directly in the output table!!!
37 {
52 };
53 
54 enum class HtmlOut {
55  TableNode,
57  OleNode,
58  Div,
59  MultiCol,
60  Spacer,
61  Control,
62  AMarquee,
63  Marquee,
65  OleGraphic,
66  Span
67 };
68 
69 enum class HtmlPosition {
70  Prefix,
71  Before,
72  Inside,
73  Any
74 };
75 
76 enum class HtmlContainerFlags {
77  NONE = 0x00,
78  Span = 0x01,
79  Div = 0x02,
80 };
81 namespace o3tl {
82  template<> struct typed_flags<HtmlContainerFlags> : is_typed_flags<HtmlContainerFlags, 0x03> {};
83 }
84 
85 const sal_uInt16 MAX_FRMTYPES = HTML_FRMTYPE_END;
86 const sal_uInt16 MAX_BROWSERS = 4;
87 
88 struct AllHtmlFlags {
92 };
98 
100 {
101  const SwFrameFormat *m_pFrameFormat; // the frame
102  const SdrObject *m_pSdrObject; // maybe Sdr-Object
103  std::unique_ptr<SwNodeIndex> m_pNodeIdex; // Node-Index
104  sal_uInt32 m_nOrdNum; // from SwPosFlyFrame
105  sal_Int32 m_nContentIndex; // its position in content
107 
108  SwHTMLPosFlyFrame(const SwHTMLPosFlyFrame&) = delete;
110 
111 public:
112 
113  SwHTMLPosFlyFrame( const SwPosFlyFrame& rPosFly,
114  const SdrObject *pSdrObj, AllHtmlFlags nAllFlags );
115 
116  bool operator<( const SwHTMLPosFlyFrame& ) const;
117 
118  const SwFrameFormat& GetFormat() const { return *m_pFrameFormat; }
119  const SdrObject* GetSdrObject() const { return m_pSdrObject; }
120  const SwNodeIndex& GetNdIndex() const { return *m_pNodeIdex; }
121  sal_Int32 GetContentIndex() const { return m_nContentIndex; }
122  AllHtmlFlags const & GetOutMode() const { return m_nAllFlags; }
123  HtmlOut GetOutFn() const { return m_nAllFlags.nOut; }
124  HtmlPosition GetOutPos() const { return m_nAllFlags.nPosition; }
125 };
126 
128  : public o3tl::sorted_vector<std::unique_ptr<SwHTMLPosFlyFrame>,
129  o3tl::less_uniqueptr_to<SwHTMLPosFlyFrame>,
130  o3tl::find_partialorder_ptrequals>
131 {};
132 
133 #endif
134 
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
HtmlContainerFlags nContainer
Definition: htmlfly.hxx:91
HtmlOut nOut
Definition: htmlfly.hxx:89
sal_Int32 GetContentIndex() const
Definition: htmlfly.hxx:121
std::unique_ptr< SwNodeIndex > m_pNodeIdex
Definition: htmlfly.hxx:103
HtmlContainerFlags
Definition: htmlfly.hxx:76
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:120
HtmlPosition GetOutPos() const
Definition: htmlfly.hxx:124
const sal_uInt16 MAX_BROWSERS
Definition: htmlfly.hxx:86
SwHTMLPosFlyFrame(const SwHTMLPosFlyFrame &)=delete
AllHtmlFlags m_nAllFlags
Definition: htmlfly.hxx:106
const SwFrameFormat & GetFormat() const
Definition: htmlfly.hxx:118
Style of a layout element.
Definition: frmfmt.hxx:59
const SwFrameFormat * m_pFrameFormat
Definition: htmlfly.hxx:101
HtmlOut GetOutFn() const
Definition: htmlfly.hxx:123
AllHtmlFlags const aHTMLOutFramePageFlyTable[MAX_FRMTYPES][MAX_BROWSERS]
Definition: htmlflyt.cxx:24
Marks a node in the document model.
Definition: ndindex.hxx:30
AllHtmlFlags const & GetOutMode() const
Definition: htmlfly.hxx:122
SwHTMLFrameType
Definition: htmlfly.hxx:36
const SdrObject * m_pSdrObject
Definition: htmlfly.hxx:102
SwHTMLPosFlyFrame & operator=(const SwHTMLPosFlyFrame &)=delete
AllHtmlFlags const aHTMLOutFrameParaOtherTable[MAX_FRMTYPES][MAX_BROWSERS]
Definition: htmlflyt.cxx:313
const SdrObject * GetSdrObject() const
Definition: htmlfly.hxx:119
HtmlOut
Definition: htmlfly.hxx:54
HtmlPosition
Definition: htmlfly.hxx:69
HtmlPosition nPosition
Definition: htmlfly.hxx:90
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:105
sal_uInt32 m_nOrdNum
Definition: htmlfly.hxx:104
const sal_uInt16 MAX_FRMTYPES
Definition: htmlfly.hxx:85