1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632
|
namespace Poppler {
class AnnotationUtils {
%TypeHeaderCode
#include <qt4/poppler-qt4.h>
#include <qt4/poppler-annotation.h>
%End
public:
static Poppler::Annotation * createAnnotation( const QDomElement & annElement );
static void storeAnnotation( const Poppler::Annotation * ann,
QDomElement & annElement, QDomDocument & document );
static QDomElement findChildElement( const QDomNode & parentNode,
const QString & name );
}; // class AnnotationUtils
class Annotation {
%TypeHeaderCode
#include <qt4/poppler-qt4.h>
#include <qt4/poppler-annotation.h>
%End
public:
enum SubType { AText = 1, ALine = 2, AGeom = 3, AHighlight = 4, AStamp = 5,
AInk = 6, ALink = 7, ACaret = 8, AFileAttachment = 9, ASound = 10,
AMovie = 11, A_BASE = 0 };
enum Flag { Hidden = 1, FixedSize = 2, FixedRotation = 4, DenyPrint = 8,
DenyWrite = 16, DenyDelete = 32, ToggleHidingOnMouse = 64, External = 128 };
enum LineStyle { Solid = 1, Dashed = 2, Beveled = 4, Inset = 8, Underline = 16 };
enum LineEffect { NoEffect = 1, Cloudy = 2};
enum RevScope { Reply = 1, Group = 2, Delete = 4 };
enum RevType { None = 1, Marked = 2, Unmarked = 4, Accepted = 8, Rejected = 16, Cancelled = 32, Completed = 64 };
QString author() const;
void setAuthor( const QString &author );
QString contents() const;
void setContents( const QString &contents );
QString uniqueName() const;
void setUniqueName( const QString &uniqueName );
QDateTime modificationDate() const;
void setModificationDate( const QDateTime &date );
QDateTime creationDate() const;
void setCreationDate( const QDateTime &date );
int flags() const;
void setFlags( int flags );
QRectF boundary() const;
void setBoundary( const QRectF &boundary );
%If(- POPPLER_V0_18_0)
struct Style {
// appearance properties
QColor color; // black
double opacity; // 1.0
// pen properties
double width; // 1.0
Poppler::Annotation::LineStyle style; // LineStyle::Solid
double xCorners; // 0.0
double yCorners; // 0.0
int marks; // 3
int spaces; // 0
// pen effects
Poppler::Annotation::LineEffect effect; // LineEffect::NoEffect
double effectIntensity; // 1.0
// default initializer
Style();
};
Style style;
struct Window {
// window state (Hidden, FixedRotation, Deny* flags allowed)
int flags; // -1 (never initialized) -> 0 (if inited and shown)
// geometric properties
QPointF topLeft; // no default, inited to boundary.topLeft
int width; // no default
int height; // no default
// window contens/override properties
QString title; // '' text in the titlebar (overrides author)
QString summary; // '' short description (displayed if not empty)
QString text; // '' text for the window (overrides annot->contents)
// default initializer
Window();
};
Window window;
struct Revision {
// child revision
Poppler::Annotation * annotation; // not null
// scope and type of revision
Poppler::Annotation::RevScope scope; // Reply
Poppler::Annotation::RevType type; // None
// default initializer
Revision();
};
// QLinkedList< Poppler::Annotation::Revision >& revisions();
const QLinkedList< Poppler::Annotation::Revision >& revisions() const;
%End
virtual SubType subType() const = 0;
%If(- POPPLER_V0_18_0)
virtual void store( QDomNode & parentNode, QDomDocument & document ) const;
%End
virtual ~Annotation();
private:
Annotation(const Poppler::Annotation&);
%If(POPPLER_V0_20_0 -)
virtual void store( QDomNode & parentNode, QDomDocument & document ) const;
%End
%ConvertToSubClassCode
switch (sipCpp->subType()) {
case Poppler::Annotation::AText:
sipType = sipType_Poppler_TextAnnotation;
break;
case Poppler::Annotation::ALine:
sipType = sipType_Poppler_LineAnnotation;
break;
case Poppler::Annotation::AGeom:
sipType = sipType_Poppler_GeomAnnotation;
break;
case Poppler::Annotation::AHighlight:
sipType = sipType_Poppler_HighlightAnnotation;
break;
case Poppler::Annotation::AStamp:
sipType = sipType_Poppler_StampAnnotation;
break;
case Poppler::Annotation::AInk:
sipType = sipType_Poppler_InkAnnotation;
break;
case Poppler::Annotation::ALink:
sipType = sipType_Poppler_LinkAnnotation;
break;
case Poppler::Annotation::ACaret:
sipType = sipType_Poppler_CaretAnnotation;
break;
case Poppler::Annotation::AFileAttachment:
sipType = sipType_Poppler_FileAttachmentAnnotation;
break;
case Poppler::Annotation::ASound:
sipType = sipType_Poppler_SoundAnnotation;
break;
case Poppler::Annotation::AMovie:
sipType = sipType_Poppler_MovieAnnotation;
break;
default:
sipType = sipType_Poppler_Annotation;
}
%End
}; // class Annotation
class TextAnnotation : Poppler::Annotation {
%TypeHeaderCode
#include <qt4/poppler-qt4.h>
#include <qt4/poppler-annotation.h>
%End
public:
%If(- POPPLER_V0_18_0)
TextAnnotation();
TextAnnotation( const QDomNode &node );
%End
virtual ~TextAnnotation();
%If(- POPPLER_V0_18_0)
virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
%End
virtual SubType subType() const;
enum TextType { Linked, InPlace };
enum InplaceIntent { Unknown, Callout, TypeWriter };
TextType textType() const;
%If(- POPPLER_V0_18_0)
void setTextType( TextType type );
%End
QString textIcon() const;
void setTextIcon( const QString &icon );
QFont textFont() const;
void setTextFont( const QFont &font );
int inplaceAlign() const;
void setInplaceAlign( int align );
QString inplaceText() const;
void setInplaceText( const QString &text );
QPointF calloutPoint( int id ) const;
%If(- POPPLER_V0_18_0)
void setCalloutPoint( int id, const QPointF &point );
%End
InplaceIntent inplaceIntent() const;
void setInplaceIntent( InplaceIntent intent );
private:
%If(POPPLER_V0_20_0 -)
TextAnnotation();
TextAnnotation( const QDomNode &node );
virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
void setTextType( TextType type );
%End
TextAnnotation(const Poppler::TextAnnotation&);
}; // class TextAnnotation
class LineAnnotation : Poppler::Annotation {
%TypeHeaderCode
#include <qt4/poppler-qt4.h>
#include <qt4/poppler-annotation.h>
%End
public:
%If(- POPPLER_V0_18_0)
LineAnnotation();
LineAnnotation( const QDomNode &node );
%End
virtual ~LineAnnotation();
%If(- POPPLER_V0_18_0)
virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
%End
virtual SubType subType() const;
enum TermStyle { Square, Circle, Diamond, OpenArrow, ClosedArrow, None,
Butt, ROpenArrow, RClosedArrow, Slash };
enum LineIntent { Unknown, Arrow, Dimension, PolygonCloud };
QLinkedList<QPointF> linePoints() const;
void setLinePoints( const QLinkedList<QPointF> &points );
TermStyle lineStartStyle() const;
void setLineStartStyle( TermStyle style );
TermStyle lineEndStyle() const;
void setLineEndStyle( TermStyle style );
bool isLineClosed() const;
void setLineClosed( bool closed );
QColor lineInnerColor() const;
void setLineInnerColor( const QColor &color );
double lineLeadingForwardPoint() const;
void setLineLeadingForwardPoint( double point );
double lineLeadingBackPoint() const;
void setLineLeadingBackPoint( double point );
bool lineShowCaption() const;
void setLineShowCaption( bool show );
LineIntent lineIntent() const;
void setLineIntent( LineIntent intent );
private:
%If(POPPLER_V0_20_0 -)
LineAnnotation();
LineAnnotation( const QDomNode &node );
virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
%End
LineAnnotation(const Poppler::LineAnnotation&);
}; // class LineAnnotation
class GeomAnnotation : Poppler::Annotation {
%TypeHeaderCode
#include <qt4/poppler-qt4.h>
#include <qt4/poppler-annotation.h>
%End
public:
%If(- POPPLER_V0_18_0)
GeomAnnotation();
GeomAnnotation( const QDomNode &node );
%End
virtual ~GeomAnnotation();
%If(- POPPLER_V0_18_0)
virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
%End
virtual SubType subType() const;
enum GeomType { InscribedSquare, InscribedCircle };
GeomType geomType() const;
void setGeomType( GeomType style );
QColor geomInnerColor() const;
void setGeomInnerColor( const QColor &color );
%If(- POPPLER_V0_18_0)
int geomPointWidth() const;
void setGeomPointWidth( int width );
%End
private:
%If(POPPLER_V0_20_0 -)
GeomAnnotation();
GeomAnnotation( const QDomNode &node );
virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
%End
GeomAnnotation(const Poppler::GeomAnnotation&);
}; // class GeomAnnotation
class HighlightAnnotation : Poppler::Annotation {
%TypeHeaderCode
#include <qt4/poppler-qt4.h>
#include <qt4/poppler-annotation.h>
%End
public:
%If(- POPPLER_V0_18_0)
HighlightAnnotation();
HighlightAnnotation( const QDomNode &node );
%End
virtual ~HighlightAnnotation();
%If(- POPPLER_V0_18_0)
virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
%End
virtual SubType subType() const;
enum HighlightType {
Highlight,
Squiggly,
Underline,
StrikeOut,
};
struct Quad {
QPointF * points;
%GetCode
sipPy = PyList_New(4);
PyObject* obj;
for (SIP_SSIZE_T i = 0; i < 4; ++i)
{
QPointF *point = new QPointF(sipCpp->points[i]);
obj = sipConvertFromNewType(point, sipType_QPointF, NULL);
PyList_SET_ITEM(sipPy, i, obj);
}
%End
%SetCode
SIP_SSIZE_T len;
if (!PySequence_Check(sipPy) || (len = PySequence_Size(sipPy)) != 4)
sipErr = 1;
else
{
for (SIP_SSIZE_T i = 0; i < 4; ++i)
{
PyObject *itm = PySequence_ITEM(sipPy, i);
bool ok = (itm && sipCanConvertToType(itm, sipType_QPointF, SIP_NOT_NONE));
Py_XDECREF(itm);
if (!ok)
{
sipErr = 1;
break;
}
}
}
if (sipErr == 1)
PyErr_SetString(PyExc_ValueError, "Quad.points must be a sequence of exactly 4 QPointF() instances");
else
{
int iserr = 0;
for (SIP_SSIZE_T i = 0; i < 4; ++i)
{
PyObject *itm = PySequence_ITEM(sipPy, i);
QPointF *point = reinterpret_cast<QPointF *>(sipConvertToType(itm, sipType_QPointF, 0, 0, 0, &iserr));
sipCpp->points[i] = *point;
Py_DECREF(itm);
}
}
%End
bool capStart;
bool capEnd;
double feather;
};
HighlightType highlightType() const;
void setHighlightType( HighlightType type );
QList< Poppler::HighlightAnnotation::Quad > highlightQuads() const;
void setHighlightQuads( const QList< Poppler::HighlightAnnotation::Quad > &quads );
private:
%If(POPPLER_V0_20_0 -)
HighlightAnnotation();
HighlightAnnotation( const QDomNode &node );
virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
%End
HighlightAnnotation(const Poppler::HighlightAnnotation&);
}; // class HighlightAnnotation
class StampAnnotation : Poppler::Annotation {
%TypeHeaderCode
#include <qt4/poppler-qt4.h>
#include <qt4/poppler-annotation.h>
%End
public:
%If(- POPPLER_V0_18_0)
StampAnnotation();
StampAnnotation( const QDomNode &node );
%End
virtual ~StampAnnotation();
%If(- POPPLER_V0_18_0)
virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
%End
virtual SubType subType() const;
QString stampIconName() const;
void setStampIconName( const QString &name );
private:
%If(POPPLER_V0_20_0 -)
StampAnnotation();
StampAnnotation( const QDomNode &node );
virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
%End
}; // class StampAnnotation
class InkAnnotation : Poppler::Annotation {
%TypeHeaderCode
#include <qt4/poppler-qt4.h>
#include <qt4/poppler-annotation.h>
%End
public:
%If(- POPPLER_V0_18_0)
InkAnnotation();
InkAnnotation( const QDomNode &node );
%End
virtual ~InkAnnotation();
%If(- POPPLER_V0_18_0)
virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
%End
virtual SubType subType() const;
QList< QLinkedList<QPointF> > inkPaths() const;
void setInkPaths( const QList< QLinkedList<QPointF> > &paths );
private:
%If(POPPLER_V0_20_0 -)
InkAnnotation();
InkAnnotation( const QDomNode &node );
virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
%End
InkAnnotation(const Poppler::InkAnnotation&);
}; // class InkAnnotation
class LinkAnnotation : Poppler::Annotation {
%TypeHeaderCode
#include <qt4/poppler-qt4.h>
#include <qt4/poppler-annotation.h>
%End
public:
%If(- POPPLER_V0_18_0)
LinkAnnotation();
LinkAnnotation( const QDomNode &node );
%End
virtual ~LinkAnnotation();
%If(- POPPLER_V0_18_0)
virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
%End
virtual SubType subType() const;
enum HighlightMode { None, Invert, Outline, Push };
%If(- POPPLER_V0_18_0)
Poppler::Link* linkDestionation() const;
%End
%If(POPPLER_V0_20_0 -)
Poppler::Link* linkDestination() const;
%End
void setLinkDestination( Poppler::Link *link );
HighlightMode linkHighlightMode() const;
void setLinkHighlightMode( HighlightMode mode );
QPointF linkRegionPoint( int id ) const;
void setLinkRegionPoint( int id, const QPointF &point );
private:
%If(POPPLER_V0_20_0 -)
LinkAnnotation();
LinkAnnotation( const QDomNode &node );
virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
%End
LinkAnnotation(const Poppler::LinkAnnotation&);
}; // class LinkAnnotation
class CaretAnnotation : Poppler::Annotation {
%TypeHeaderCode
#include <qt4/poppler-qt4.h>
#include <qt4/poppler-annotation.h>
%End
public:
%If(- POPPLER_V0_18_0)
CaretAnnotation();
CaretAnnotation( const QDomNode &node );
%End
virtual ~CaretAnnotation();
%If(- POPPLER_V0_18_0)
virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
%End
virtual SubType subType() const;
enum CaretSymbol { None, P };
CaretSymbol caretSymbol() const;
void setCaretSymbol( CaretSymbol symbol );
private:
%If(POPPLER_V0_20_0 -)
CaretAnnotation();
CaretAnnotation( const QDomNode &node );
virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
%End
CaretAnnotation(const Poppler::CaretAnnotation&);
}; // class CaretAnnotation
class FileAttachmentAnnotation : Poppler::Annotation {
%TypeHeaderCode
#include <qt4/poppler-qt4.h>
#include <qt4/poppler-annotation.h>
%End
public:
%If(- POPPLER_V0_18_0)
FileAttachmentAnnotation();
FileAttachmentAnnotation( const QDomNode &node );
%End
virtual ~FileAttachmentAnnotation();
%If(- POPPLER_V0_18_0)
virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
%End
virtual SubType subType() const;
QString fileIconName() const;
void setFileIconName( const QString &icon );
Poppler::EmbeddedFile* embeddedFile() const;
void setEmbeddedFile( Poppler::EmbeddedFile *ef );
private:
%If(POPPLER_V0_20_0 -)
FileAttachmentAnnotation();
FileAttachmentAnnotation( const QDomNode &node );
virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
%End
FileAttachmentAnnotation(const Poppler::FileAttachmentAnnotation&);
}; // class FileAttachmentAnnotation
class SoundAnnotation : Poppler::Annotation {
%TypeHeaderCode
#include <qt4/poppler-qt4.h>
#include <qt4/poppler-annotation.h>
%End
public:
%If(- POPPLER_V0_18_0)
SoundAnnotation();
SoundAnnotation( const QDomNode &node );
%End
virtual ~SoundAnnotation();
%If(- POPPLER_V0_18_0)
virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
%End
virtual SubType subType() const;
QString soundIconName() const;
void setSoundIconName( const QString &icon );
Poppler::SoundObject* sound() const;
void setSound( Poppler::SoundObject *ef );
private:
%If(POPPLER_V0_20_0 -)
SoundAnnotation();
SoundAnnotation( const QDomNode &node );
virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
%End
SoundAnnotation(const Poppler::SoundAnnotation&);
}; // class SoundAnnotation
class MovieAnnotation : Poppler::Annotation {
%TypeHeaderCode
#include <qt4/poppler-qt4.h>
#include <qt4/poppler-annotation.h>
%End
public:
%If(- POPPLER_V0_18_0)
MovieAnnotation();
MovieAnnotation( const QDomNode &node );
%End
virtual ~MovieAnnotation();
%If(- POPPLER_V0_18_0)
virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
%End
virtual SubType subType() const;
Poppler::MovieObject* movie() const;
void setMovie( Poppler::MovieObject *movie );
QString movieTitle() const;
void setMovieTitle( const QString &title );
private:
%If(POPPLER_V0_20_0 -)
MovieAnnotation();
MovieAnnotation( const QDomNode &node );
virtual void store( QDomNode &parentNode, QDomDocument &document ) const;
%End
MovieAnnotation(const Poppler::MovieAnnotation&);
}; // class MovieAnnotation
}; // namespace Poppler
/* kate: indent-width 4; space-indent on; hl c++; indent-mode cstyle; */
|