| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
#ifndef QUATTRO9_GRAPH_H |
| 23 |
#define QUATTRO9_GRAPH_H |
| 24 |
|
| 25 |
#include <ostream> |
| 26 |
#include <map> |
| 27 |
#include <vector> |
| 28 |
|
| 29 |
#include <librevenge-stream/librevenge-stream.h> |
| 30 |
|
| 31 |
#include "libwps_internal.h" |
| 32 |
|
| 33 |
#include "WPSDebug.h" |
| 34 |
#include "WKSContentListener.h" |
| 35 |
#include "WPSGraphicStyle.h" |
| 36 |
|
| 37 |
namespace Quattro9GraphInternal |
| 38 |
{ |
| 39 |
struct Graph; |
| 40 |
struct Shape; |
| 41 |
struct State; |
| 42 |
|
| 43 |
class SubDocument; |
| 44 |
} |
| 45 |
|
| 46 |
class Quattro9Parser; |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
class Quattro9Graph |
| 53 |
{ |
| 54 |
public: |
| 55 |
friend class Quattro9Parser; |
| 56 |
friend class Quattro9GraphInternal::SubDocument; |
| 57 |
|
| 58 |
|
| 59 |
explicit Quattro9Graph(Quattro9Parser &parser); |
| 60 |
|
| 61 |
~Quattro9Graph(); |
| 62 |
|
| 63 |
void setListener(WKSContentListenerPtr &listen) |
| 64 |
{ |
| 65 |
m_listener = listen; |
| 66 |
} |
| 67 |
|
| 68 |
void cleanState(); |
| 69 |
|
| 70 |
void updateState(); |
| 71 |
|
| 72 |
|
| 73 |
bool getColor(int id, WPSColor &color) const; |
| 74 |
|
| 75 |
bool getPattern(int id, WPSGraphicStyle::Pattern &pattern) const; |
| 76 |
protected: |
| 77 |
|
| 78 |
int version() const; |
| 79 |
|
| 80 |
void storeObjects(std::map<librevenge::RVNGString,WPSEmbeddedObject> const &nameToObjectMap); |
| 81 |
|
| 82 |
|
| 83 |
bool sendPageGraphics(int sheetId) const; |
| 84 |
|
| 85 |
bool sendShape(Quattro9GraphInternal::Graph const &graph, int sheetId) const; |
| 86 |
|
| 87 |
bool sendShape(Quattro9GraphInternal::Shape const &shape, WPSTransformation const &transf) const; |
| 88 |
|
| 89 |
bool sendShape(WPSGraphicShape const &shape, WPSGraphicStyle const &style, WPSTransformation const &transf) const; |
| 90 |
|
| 91 |
bool sendOLE(Quattro9GraphInternal::Graph const &graph, int sheetId) const; |
| 92 |
|
| 93 |
bool sendTextbox(Quattro9GraphInternal::Graph const &graph, int sheetId) const; |
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
bool readBeginEnd(std::shared_ptr<WPSStream> stream, int sheetId); |
| 101 |
|
| 102 |
bool readBeginEndZone(std::shared_ptr<WPSStream> const &stream); |
| 103 |
|
| 104 |
bool readGraphHeader(std::shared_ptr<WPSStream> const &stream); |
| 105 |
|
| 106 |
static bool readFrameStyle(std::shared_ptr<WPSStream> const &stream); |
| 107 |
|
| 108 |
static bool readFramePattern(std::shared_ptr<WPSStream> const &stream); |
| 109 |
|
| 110 |
static bool readFrameHeader(std::shared_ptr<WPSStream> const &stream); |
| 111 |
|
| 112 |
bool readOLEName(std::shared_ptr<WPSStream> const &stream); |
| 113 |
|
| 114 |
bool readShape(std::shared_ptr<WPSStream> const &stream); |
| 115 |
|
| 116 |
bool readShapeRec(std::shared_ptr<WPSStream> const &stream, long endPos, Quattro9GraphInternal::Shape &shape, WPSGraphicStyle const &actStyle); |
| 117 |
|
| 118 |
|
| 119 |
bool readTextboxStyle(std::shared_ptr<WPSStream> const &stream); |
| 120 |
|
| 121 |
bool readTextboxText(std::shared_ptr<WPSStream> const &stream); |
| 122 |
|
| 123 |
private: |
| 124 |
Quattro9Graph(Quattro9Graph const &orig) = delete; |
| 125 |
Quattro9Graph &operator=(Quattro9Graph const &orig) = delete; |
| 126 |
std::shared_ptr<WKSContentListener> m_listener; |
| 127 |
|
| 128 |
Quattro9Parser &m_mainParser; |
| 129 |
|
| 130 |
std::shared_ptr<Quattro9GraphInternal::State> m_state; |
| 131 |
}; |
| 132 |
|
| 133 |
#endif |
| 134 |
|