Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

AIPlug Class Reference

Adobe Illustrator importer plugin. More...

#include <importai.h>

Collaboration diagram for AIPlug:

Collaboration graph
[legend]

List of all members.

Public Slots

void cancelRequested ()

Public Member Functions

 AIPlug (ScribusDoc *doc, int flags)
 Create the AI importer window.
 ~AIPlug ()
bool import (QString fn, int flags, bool showProgress=true)
 Perform import.

Private Member Functions

bool extractFromPDF (QString infile, QString outfile)
 Does the conversion.
bool decompressAIData (QString &fName)
bool parseHeader (QString fName, double &x, double &y, double &b, double &h)
QString removeAIPrefix (QString comment)
QString parseColor (QString data)
QString parseColorGray (QString data)
QString parseColorRGB (QString data)
QString parseCustomColor (QString data, double &shade)
QString parseCustomColorX (QString data, double &shade, QString type)
QStringList getStrings (QString data)
void getCommands (QString data, QStringList &commands)
void processData (QString data)
void processGradientData (QString data)
void processPattern (QDataStream &ts)
void processRaster (QDataStream &ts)
void processComment (QDataStream &ts, QString comment)
bool convert (QString fn)

Private Attributes

QList< PageItem * > Elements
QList< PageItem * > PatternElements
QStack< QList< PageItem * > > groupStack
ColorList CustColors
double baseX
double baseY
double docX
double docY
double docWidth
double docHeight
double LineW
Qt::PenCapStyle CapStyle
Qt::PenJoinStyle JoinStyle
double DashOffset
QList< double > DashPattern
double Opacity
int blendMode
QString CurrColorFill
QString CurrColorStroke
double CurrStrokeShade
double CurrFillShade
bool fillRule
bool itemLocked
FPointArray Coords
FPointArray clipCoords
FPoint currentPoint
int currentLayer
bool firstLayer
bool FirstU
bool WasU
bool ClosedPath
bool interactive
MultiProgressDialogprogressDialog
bool cancel
ScribusDocm_Doc
SelectiontmpSel
QStringList importedColors
int importerFlags
QStringList commandList
bool convertedPDF
QMap< QString, VGradientm_gradients
VGradient currentGradient
QString currentGradientName
QMatrix currentGradientMatrix
QPointF currentGradientOrigin
double currentGradientAngle
double currentGradientLenght
bool gradientMode
bool wasBC
bool itemRendered
QMatrix startMatrix
QMatrix endMatrix
bool patternMode
QString currentPatternDefName
QString currentPatternName
double patternX1
double patternY1
double patternX2
double patternY2
double currentPatternX
double currentPatternY
double currentPatternXScale
double currentPatternYScale
double currentPatternRotation
QString docCreator
QString docDate
QString docTime
QString docOrganisation
QString docTitle
int textMode
QMatrix textMatrix
StoryText textData
QString textFont
double textSize
double maxWidth
double tempW
double maxHeight
double textKern
double textScaleH
double textScaleV
int startCurrentTextRange
int endCurrentTextRange
int imgNum
QString baseFile


Detailed Description

Adobe Illustrator importer plugin.

Definition at line 27 of file importai.h.


Constructor & Destructor Documentation

AIPlug::AIPlug ( ScribusDoc doc,
int  flags 
)

Create the AI importer window.

Author:
Franz Schmid
Date:
Parameters:
fName QString
flags combination of loadFlags
showProgress if progress must be displayed
Return values:
EPSPlug plugin

Definition at line 59 of file importai.cpp.

References interactive, LoadSavePlugin::lfInteractive, m_Doc, and tmpSel.

AIPlug::~AIPlug (  ) 

Definition at line 374 of file importai.cpp.

References tmpSel.


Member Function Documentation

bool AIPlug::import ( QString  fn,
int  flags,
bool  showProgress = true 
)

Perform import.

Author:
Franz Schmid
Date:
Parameters:
fn QString
flags combination of loadFlags
showProgress if progress must be displayed
Return values:
bool true if import was ok

Definition at line 66 of file importai.cpp.

References MultiProgressDialog::addExtraProgressBars(), Selection::addItem(), ScribusView::addPage(), ScribusDoc::addPage(), FPointArray::addPoint(), ScribusView::adjustCanvas(), PrefsManager::appPrefs, baseFile, baseX, baseY, cancel, cancelRequested(), ScribusView::canvasOrigin(), ScribusDoc::changed(), Selection::clear(), convert(), convertedPDF, ScribusDoc::currentPage(), CustColors, toolPrefs::dBrush, decompressAIData(), docCreator, docDate, docHeight, docOrganisation, docTime, docTitle, ScribusDoc::documentInfo, docWidth, docX, docY, ScribusDoc::DoDrawing, ScribusMainWindow::doFileNew(), toolPrefs::dPen, ScribusDoc::DragElements, ScribusDoc::DraggedElem, ScribusDoc::DragP, ScribusView::DrawNew(), Elements, extractFromPDF(), getShortPathName(), ScPaths::getTempFileDir(), ScribusDoc::GroupCounter, PageItem::Groups, PageItem::groupsLastItem, ScribusMainWindow::HaveNewDoc(), PageItem::height, importerFlags, PrefsManager::instance(), interactive, PageItem::isGroupControl, ScribusDoc::isLoading(), ScribusDoc::itemAdd(), PageItem::ItemNr, ScribusDoc::Items, ScribusDoc::itemSelection_DeleteItem(), LoadSavePlugin::lfCreateDoc, LoadSavePlugin::lfInsertPage, LoadSavePlugin::lfInteractive, LoadSavePlugin::lfScripted, PageItem::lineWidth, loadIcon(), m_Doc, ScribusDoc::m_pageSize, ScribusDoc::m_Selection, ScribusDoc::maxCanvasCoordinate, ScribusDoc::minCanvasCoordinate, ScribusDoc::PageColors, ApplicationPrefs::PageHeight, ScribusDoc::PageOri, ApplicationPrefs::PageWidth, parseHeader(), FPointArray::point(), PageItem::Polygon, ScribusCore::primaryMainWindow(), progressDialog, PageItem::Rectangle, ScribusDoc::reformPages(), FPointArray::resize(), PageItem::rotation, ScribusView::scale(), ScCore, ScribusDoc::scMW(), ScribusMainWindow::ScriptRunning, DocumentInformation::setAuthor(), ScribusView::setCanvasOrigin(), DocumentInformation::setDate(), Selection::setGroupRect(), PageItem::setItemName(), ScribusDoc::setLoading(), MultiProgressDialog::setOverallProgress(), MultiProgressDialog::setOverallTotalSteps(), ScribusDoc::setPage(), MultiProgressDialog::setProgress(), DocumentInformation::setPublisher(), PageItem::setTextFlowMode(), DocumentInformation::setTitle(), PageItem::TextFlowUsesFrameShape, tmpSel, ScribusDoc::toolSettings, tr(), CommonStrings::tr_Cancel, ScribusView::updateCanvas(), ScribusView::updatesOn(), ScribusCore::usingGUI(), ScribusDoc::view(), PageItem::width, ScriXmlDoc::WriteElem(), FPoint::x(), Page::xOffset(), PageItem::xPos, FPoint::y(), Page::yOffset(), and PageItem::yPos.

Referenced by ImportAIPlugin::import().

bool AIPlug::extractFromPDF ( QString  infile,
QString  outfile 
) [private]

Does the conversion.

Author:
Franz Schmid
Date:
Parameters:
fn QString
x X position
y Y position
b double
h double
Return values:
bool true if conversion was ok

Definition at line 379 of file importai.cpp.

References data, and doc.

Referenced by import().

bool AIPlug::decompressAIData ( QString &  fName  )  [private]

Definition at line 458 of file importai.cpp.

References baseFile, convertedPDF, getShortPathName(), ScPaths::getTempFileDir(), and moveFile().

Referenced by import().

bool AIPlug::parseHeader ( QString  fName,
double &  x,
double &  y,
double &  b,
double &  h 
) [private]

QString AIPlug::removeAIPrefix ( QString  comment  )  [private]

Definition at line 648 of file importai.cpp.

Referenced by processComment(), and processPattern().

QString AIPlug::parseColor ( QString  data  )  [private]

QString AIPlug::parseColorGray ( QString  data  )  [private]

QString AIPlug::parseColorRGB ( QString  data  )  [private]

QString AIPlug::parseCustomColor ( QString  data,
double &  shade 
) [private]

QString AIPlug::parseCustomColorX ( QString  data,
double &  shade,
QString  type 
) [private]

QStringList AIPlug::getStrings ( QString  data  )  [private]

Definition at line 916 of file importai.cpp.

References SpecialChars::PARSEP.

Referenced by parseHeader(), and processData().

void AIPlug::getCommands ( QString  data,
QStringList &  commands 
) [private]

Definition at line 981 of file importai.cpp.

References commandList.

Referenced by processData(), processGradientData(), and processRaster().

void AIPlug::processData ( QString  data  )  [private]

Definition at line 1050 of file importai.cpp.

References Selection::addItem(), ScribusDoc::addLayer(), ScribusDoc::AdjustItemSize(), ScribusDoc::AllFonts, StoryText::append(), StoryText::applyCharStyle(), PrefsManager::appPrefs, baseX, baseY, blendMode, CapStyle, ScribusDoc::changeLayerName(), StoryText::charStyle(), StoryText::clear(), Selection::clear(), PageItem::Clip, clipCoords, PageItem::ClipEdited, Coords, FPointArray::copy(), Selection::count(), CurrColorFill, CurrColorStroke, SCFontsIterator::current(), currentGradientAngle, currentGradientLenght, currentGradientMatrix, currentGradientName, currentGradientOrigin, currentLayer, ScribusDoc::currentPage(), currentPatternDefName, currentPatternName, currentPatternRotation, currentPatternX, currentPatternXScale, currentPatternY, currentPatternYScale, currentPoint, CurrFillShade, CurrStrokeShade, toolPrefs::defFont, docHeight, docX, docY, Elements, endCurrentTextRange, endMatrix, PageItem::fill_gradient, fillRule, firstLayer, FirstU, FlattenPath(), CharStyle::font, PageItem::FrameType, getCommands(), getMaxClipF(), MissingFont::getReplacementFont(), getRotationFromMatrix(), getStrings(), ApplicationPrefs::GFontSub, gradientMode, PageItem::GrEndX, PageItem::GrEndY, groupStack, PageItem::GrStartX, PageItem::GrStartY, PageItem::GrType, SCFontsIterator::hasNext(), PageItem::height, importerFlags, StoryText::insertChars(), PrefsManager::instance(), ScribusDoc::itemAdd(), Selection::itemAt(), itemLocked, itemRendered, ScribusDoc::Items, ScribusDoc::itemSelection_GroupObjects(), PageItem::itemText, JoinStyle, StoryText::length(), LoadSavePlugin::lfCreateDoc, SpecialChars::LINEBREAK, LineW, m_Doc, m_gradients, M_PI, maxHeight, maxWidth, SCFontsIterator::next(), CommonStrings::None, Opacity, parseColor(), parseColorGray(), parseColorRGB(), parseCustomColor(), parseCustomColorX(), SpecialChars::PARSEP, PatternElements, patternMode, patternX1, patternX2, patternY1, patternY2, PageItem::PoLine, PageItem::Polygon, PageItem::PolyLine, FPointArray::putPoints(), FPointArray::resize(), ScFace::scName(), ScStyle_Default, PageItem::Segments, PageItem::setFillEvenOdd(), PageItem::setFillShade(), PageItem::setFillTransparency(), ScribusDoc::setLayerLocked(), ScribusDoc::setLayerMarker(), ScribusDoc::setLayerOutline(), ScribusDoc::setLayerPrintable(), ScribusDoc::setLayerVisible(), PageItem::setLineEnd(), PageItem::setLineJoin(), PageItem::setLineShade(), PageItem::setLineTransparency(), PageItem::setLocked(), FPointArray::setMarker(), PageItem::setPattern(), PageItem::setPatternTransform(), PageItem::SetRectFrame(), ScribusDoc::setRedrawBounding(), PageItem::setRotation(), PageItem::setTextFlowMode(), PageItem::setTextToFrameDist(), PageItem::setWidthHeight(), PageItem::setXPos(), PageItem::setYPos(), FPointArray::size(), startCurrentTextRange, startMatrix, FPointArray::svgCurveToCubic(), FPointArray::svgInit(), FPointArray::svgLineTo(), FPointArray::svgMoveTo(), tempW, textData, PageItem::TextFlowDisabled, PageItem::TextFlowUsesFrameShape, textFont, PageItem::TextFrame, textKern, textMatrix, textMode, textScaleH, textScaleV, textSize, tmpSel, ScribusDoc::toolSettings, FPointArray::translate(), VGradient::type(), PageItem::Unspecified, wasBC, WasU, PageItem::width, FPoint::x(), Page::xOffset(), PageItem::xPos, FPoint::y(), Page::yOffset(), and PageItem::yPos.

Referenced by convert(), processComment(), and processPattern().

void AIPlug::processGradientData ( QString  data  )  [private]

void AIPlug::processPattern ( QDataStream &  ts  )  [private]

void AIPlug::processRaster ( QDataStream &  ts  )  [private]

void AIPlug::processComment ( QDataStream &  ts,
QString  comment 
) [private]

bool AIPlug::convert ( QString  fn  )  [private]

void AIPlug::cancelRequested (  )  [inline, slot]

Definition at line 171 of file importai.h.

References cancel.

Referenced by import().


Member Data Documentation

QList<PageItem*> AIPlug::Elements [private]

Definition at line 86 of file importai.h.

Referenced by import(), processData(), and processRaster().

QList<PageItem*> AIPlug::PatternElements [private]

Definition at line 87 of file importai.h.

Referenced by processData(), and processPattern().

QStack<QList<PageItem*> > AIPlug::groupStack [private]

Definition at line 88 of file importai.h.

Referenced by convert(), processData(), and processRaster().

Definition at line 89 of file importai.h.

Referenced by import(), and parseHeader().

double AIPlug::baseX [private]

Definition at line 90 of file importai.h.

Referenced by import(), and processData().

double AIPlug::baseY [private]

Definition at line 90 of file importai.h.

Referenced by import(), and processData().

double AIPlug::docX [private]

Definition at line 91 of file importai.h.

Referenced by import(), processData(), and processRaster().

double AIPlug::docY [private]

Definition at line 92 of file importai.h.

Referenced by import(), processData(), and processRaster().

double AIPlug::docWidth [private]

Definition at line 93 of file importai.h.

Referenced by import().

double AIPlug::docHeight [private]

Definition at line 94 of file importai.h.

Referenced by import(), processData(), and processRaster().

double AIPlug::LineW [private]

Definition at line 96 of file importai.h.

Referenced by convert(), and processData().

Qt::PenCapStyle AIPlug::CapStyle [private]

Definition at line 97 of file importai.h.

Referenced by convert(), processData(), and processRaster().

Qt::PenJoinStyle AIPlug::JoinStyle [private]

Definition at line 98 of file importai.h.

Referenced by convert(), processData(), and processRaster().

double AIPlug::DashOffset [private]

Definition at line 99 of file importai.h.

Referenced by convert().

QList<double> AIPlug::DashPattern [private]

Definition at line 100 of file importai.h.

Referenced by convert().

double AIPlug::Opacity [private]

Definition at line 101 of file importai.h.

Referenced by convert(), processData(), and processRaster().

int AIPlug::blendMode [private]

Definition at line 102 of file importai.h.

Referenced by convert(), and processData().

QString AIPlug::CurrColorFill [private]

Definition at line 103 of file importai.h.

Referenced by convert(), processData(), and processRaster().

QString AIPlug::CurrColorStroke [private]

Definition at line 104 of file importai.h.

Referenced by convert(), processData(), and processRaster().

double AIPlug::CurrStrokeShade [private]

Definition at line 105 of file