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