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 
26 class SdrObject;
27 class SwFrameFormat;
28 class SwNodeIndex;
29 class SwPosFlyFrame;
30 
31 // ATTENTION: The values of this enum are used directly in the output table!!!
33 {
48 };
49 
50 enum class HtmlOut {
51  TableNode,
53  OleNode,
54  Div,
55  MultiCol,
56  Spacer,
57  Control,
58  AMarquee,
59  Marquee,
61  OleGraphic,
62  Span
63 };
64 
65 enum class HtmlPosition {
66  Prefix,
67  Before,
68  Inside,
69  Any
70 };
71 
72 enum class HtmlContainerFlags {
73  NONE = 0x00,
74  Span = 0x01,
75  Div = 0x02,
76 };
77 namespace o3tl {
78  template<> struct typed_flags<HtmlContainerFlags> : is_typed_flags<HtmlContainerFlags, 0x03> {};
79 }
80 
81 const sal_uInt16 MAX_FRMTYPES = HTML_FRMTYPE_END;
82 const sal_uInt16 MAX_BROWSERS = 4;
83 
84 struct AllHtmlFlags {
88 };
94 
96 {
97  const SwFrameFormat *pFrameFormat; // the frame
98  const SdrObject *pSdrObject; // maybe Sdr-Object
99  SwNodeIndex *pNdIdx; // Node-Index
100  sal_uInt32 const nOrdNum; // from SwPosFlyFrame
101  sal_Int32 nContentIdx; // its position in content
103 
104  SwHTMLPosFlyFrame(const SwHTMLPosFlyFrame&) = delete;
106 
107 public:
108 
109  SwHTMLPosFlyFrame( const SwPosFlyFrame& rPosFly,
110  const SdrObject *pSdrObj, AllHtmlFlags nAllFlags );
111 
112  bool operator<( const SwHTMLPosFlyFrame& ) const;
113 
114  const SwFrameFormat& GetFormat() const { return *pFrameFormat; }
115  const SdrObject* GetSdrObject() const { return pSdrObject; }
116  const SwNodeIndex& GetNdIndex() const { return *pNdIdx; }
117  sal_Int32 GetContentIndex() const { return nContentIdx; }
118  AllHtmlFlags const & GetOutMode() const { return nAllFlags; }
119  HtmlOut GetOutFn() const { return nAllFlags.nOut; }
120  HtmlPosition GetOutPos() const { return nAllFlags.nPosition; }
121 };
122 
124  : public o3tl::sorted_vector<std::unique_ptr<SwHTMLPosFlyFrame>,
125  o3tl::less_uniqueptr_to<SwHTMLPosFlyFrame>,
126  o3tl::find_partialorder_ptrequals>
127 {};
128 
129 #endif
130 
131 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
HtmlContainerFlags nContainer
Definition: htmlfly.hxx:87
HtmlOut nOut
Definition: htmlfly.hxx:85
sal_Int32 GetContentIndex() const
Definition: htmlfly.hxx:117
HtmlContainerFlags
Definition: htmlfly.hxx:72
AllHtmlFlags const aHTMLOutFrameParaFrameTable[MAX_FRMTYPES][MAX_BROWSERS]
Definition: htmlflyt.cxx:120
bool operator<(const SwHTMLPosFlyFrame &) const
Definition: htmlfly.cxx:74
AllHtmlFlags const aHTMLOutFrameParaPrtAreaTable[MAX_FRMTYPES][MAX_BROWSERS]
Definition: htmlflyt.cxx:217
const SwNodeIndex & GetNdIndex() const
Definition: htmlfly.hxx:116
HtmlPosition GetOutPos() const
Definition: htmlfly.hxx:120
const sal_uInt16 MAX_BROWSERS
Definition: htmlfly.hxx:82
AllHtmlFlags const nAllFlags
Definition: htmlfly.hxx:102
SwHTMLPosFlyFrame(const SwHTMLPosFlyFrame &)=delete
const SwFrameFormat & GetFormat() const
Definition: htmlfly.hxx:114
Style of a layout element.
Definition: frmfmt.hxx:57
HtmlOut GetOutFn() const
Definition: htmlfly.hxx:119
SwNodeIndex * pNdIdx
Definition: htmlfly.hxx:99
AllHtmlFlags const aHTMLOutFramePageFlyTable[MAX_FRMTYPES][MAX_BROWSERS]
Definition: htmlflyt.cxx:24
Marks a node in the document model.
Definition: ndindex.hxx:31
AllHtmlFlags const & GetOutMode() const
Definition: htmlfly.hxx:118
SwHTMLFrameType
Definition: htmlfly.hxx:32
const SdrObject * pSdrObject
Definition: htmlfly.hxx:98
SwHTMLPosFlyFrame & operator=(const SwHTMLPosFlyFrame &)=delete
sal_uInt32 const nOrdNum
Definition: htmlfly.hxx:100
AllHtmlFlags const aHTMLOutFrameParaOtherTable[MAX_FRMTYPES][MAX_BROWSERS]
Definition: htmlflyt.cxx:313
const SdrObject * GetSdrObject() const
Definition: htmlfly.hxx:115
HtmlOut
Definition: htmlfly.hxx:50
HtmlPosition
Definition: htmlfly.hxx:65
HtmlPosition nPosition
Definition: htmlfly.hxx:86
For querying current flys in document.
Definition: flypos.hxx:30
const SwFrameFormat * pFrameFormat
Definition: htmlfly.hxx:97
AllHtmlFlags const aHTMLOutFrameAsCharTable[MAX_FRMTYPES][MAX_BROWSERS]
Definition: htmlflyt.cxx:409
sal_Int32 nContentIdx
Definition: htmlfly.hxx:101
const sal_uInt16 MAX_FRMTYPES
Definition: htmlfly.hxx:81