| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
#ifndef LOTUS_GRAPH_H |
| 23 |
#define LOTUS_GRAPH_H |
| 24 |
|
| 25 |
#include <ostream> |
| 26 |
#include <map> |
| 27 |
#include <string> |
| 28 |
#include <vector> |
| 29 |
|
| 30 |
#include <librevenge-stream/librevenge-stream.h> |
| 31 |
|
| 32 |
#include "libwps_internal.h" |
| 33 |
|
| 34 |
#include "WPSDebug.h" |
| 35 |
#include "WKSContentListener.h" |
| 36 |
|
| 37 |
namespace LotusGraphInternal |
| 38 |
{ |
| 39 |
struct ZoneMac; |
| 40 |
struct ZonePc; |
| 41 |
struct ZonePcList; |
| 42 |
struct ZoneWK4; |
| 43 |
struct State; |
| 44 |
|
| 45 |
class SubDocument; |
| 46 |
} |
| 47 |
|
| 48 |
class LotusParser; |
| 49 |
class LotusStyleManager; |
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
class LotusGraph |
| 56 |
{ |
| 57 |
public: |
| 58 |
friend class LotusParser; |
| 59 |
friend class LotusGraphInternal::SubDocument; |
| 60 |
|
| 61 |
|
| 62 |
explicit LotusGraph(LotusParser &parser); |
| 63 |
|
| 64 |
~LotusGraph(); |
| 65 |
|
| 66 |
void cleanState(); |
| 67 |
|
| 68 |
void setListener(WKSContentListenerPtr &listen) |
| 69 |
{ |
| 70 |
m_listener = listen; |
| 71 |
} |
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
void updateState(std::map<int,int> const &zIdToSheetIdMap, |
| 79 |
std::map<std::string,int> const &nameToChartIdMap); |
| 80 |
protected: |
| 81 |
|
| 82 |
int version() const; |
| 83 |
|
| 84 |
|
| 85 |
bool hasGraphics(int sheetId) const; |
| 86 |
|
| 87 |
void sendGraphics(int sheetId); |
| 88 |
|
| 89 |
void sendZone(LotusGraphInternal::ZonePcList const &zoneList, size_t id, WPSTransformation const &transf); |
| 90 |
|
| 91 |
void sendPicture(LotusGraphInternal::ZoneMac const &zone); |
| 92 |
|
| 93 |
void sendTextBox(std::shared_ptr<WPSStream> stream, WPSEntry const &entry); |
| 94 |
|
| 95 |
void sendTextBoxWK4(std::shared_ptr<WPSStream> stream, WPSEntry const &entry, bool isButton); |
| 96 |
|
| 97 |
|
| 98 |
bool setChartId(int chartId); |
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
bool readZoneBegin(std::shared_ptr<WPSStream> stream, long endPos); |
| 110 |
|
| 111 |
bool readZoneData(std::shared_ptr<WPSStream> stream, long endPos, int type); |
| 112 |
|
| 113 |
bool readTextBoxData(std::shared_ptr<WPSStream> stream, long endPos); |
| 114 |
|
| 115 |
bool readPictureDefinition(std::shared_ptr<WPSStream> stream, long endPos); |
| 116 |
|
| 117 |
bool readPictureData(std::shared_ptr<WPSStream> stream, long endPos); |
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
bool readFMTPictName(std::shared_ptr<WPSStream> stream); |
| 123 |
|
| 124 |
bool readZoneBeginC9(std::shared_ptr<WPSStream> stream); |
| 125 |
|
| 126 |
bool readGraphic(std::shared_ptr<WPSStream> stream); |
| 127 |
|
| 128 |
bool readFrame(std::shared_ptr<WPSStream> stream); |
| 129 |
|
| 130 |
bool readTextBoxDataD1(std::shared_ptr<WPSStream> stream); |
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
bool readGraphZone(std::shared_ptr<WPSStream> stream, int zId); |
| 136 |
|
| 137 |
bool readGraphDataZone(std::shared_ptr<WPSStream> stream, long endPos); |
| 138 |
|
| 139 |
private: |
| 140 |
LotusGraph(LotusGraph const &orig) = delete; |
| 141 |
LotusGraph &operator=(LotusGraph const &orig) = delete; |
| 142 |
std::shared_ptr<WKSContentListener> m_listener; |
| 143 |
|
| 144 |
LotusParser &m_mainParser; |
| 145 |
|
| 146 |
std::shared_ptr<LotusStyleManager> m_styleManager; |
| 147 |
|
| 148 |
std::shared_ptr<LotusGraphInternal::State> m_state; |
| 149 |
}; |
| 150 |
|
| 151 |
#endif |
| 152 |
|