Scripter2 API: Difference between revisions

From Scribus Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
[[Category:Scribus]]
Scripter2 API is described below. This is a reference for the actual documentation of new scripter.  
==Document API==
Document API is the primary access point to active document in Scribus. A DocumentAPI object may be created as '''Scripter.activeDocument'''. This will return an object of type DocumentAPI. The following methods/properties are available in DocumentAPI.


The new Scripter is composed of different modules, which are either accessible externally, or via methods of other apis.


 
* Scripter
==Layer API==
* Document API
 
* Page API
 
* Color API
 
* Layer API
==Object API==
* Printer API
 
* PDF File API
need changes!
* Text API
 
* Dialogs API
QString '''createRect'''(double x, double y, double width, double height, QString name);
* Preferences API
 
* Window API
QString '''createEllipse'''(double x, double y, double width, double height, QString name);
 
QString '''createImage'''(double x, double y, double width, double height, QString name);
 
QString '''createText'''(double x, double y, double width, double height, QString name);
 
QString '''createTable'''(double x, double y, double width, double height, int numRows, int numColumns, QString name);
 
QString '''createLine'''(double x1, double y1, double x2, double y2, QString name);
 
QString '''createPolyLine'''(QList<QVariant> list, QString name);
 
QString '''createPolygon'''(QList<QVariant> list, QString name);
 
QString '''createBezierLine'''(QList<QVariant> list, QString name);
 
QString '''createPathText'''(double x, double y, QString textbox, QString beziercurve, QString name);
 
void '''deleteObject'''(QString name);
 
void '''textFlowMode'''(QString name, int stat);
 
bool '''objectExists'''(QString name);
 
void '''setStyle'''(QString style, QString name);
 
QList<QVariant> '''getAllStyles'''();
 
void '''duplicateObject'''(QString name);
 
void '''moveObject'''(double dx, double dy, QString name);
 
void '''moveObjectAbs'''(double x, double y, QString name);
 
void '''rotateObject'''(double rot, QString name);
 
void '''rotateObjectAbs'''(double rot, QString name);
 
void '''sizeObject'''(double width, double height, QString name);
 
QString '''getSelectedObject'''(int nr);
 
long '''selectionCount'''();
 
void '''selectObject'''(QString name);
 
void '''deselectAll'''();
 
QString '''groupObjects'''(QList<QVariant> list);
 
void '''unGroupObjects'''(QString name);
 
void '''scaleGroup'''(double factor, QString name);
 
void '''loadImage'''(QString filename, QString name);
 
void '''scaleImage'''(double x, double y, QString name);
 
void '''setImageOffset'''(double x, double y, QString name);
 
void '''setImageScale'''(double x, double y, QString name);
 
void '''setImageBrightness'''(double n, QString name);
 
void '''setImageGrayscale'''(QString name);
 
bool '''lockObject'''(QString name);
 
bool '''isLocked'''(QString name);
 
void '''setScaleImageToFrame'''(bool scaletoframe, bool Proportional, QString name);
 
void '''flipObject'''(bool h, bool v, QString name);
=== Getter functions ===
QString '''getObjectType'''(QString name);
QString '''getFillColor'''(QString name);
double '''getFillTransparency'''(QString name);
int '''getBlendMode'''(QString name);
QString '''getLineColor'''(QString name);
double '''getLineTransparency'''(QString name);
int '''getLineBlendMode'''(QString name);
int '''getLineWidth'''(QString name);
int '''getLineShade'''(QString name);
int '''getLineJoin'''(QString name);
int '''getLineCap'''(QString name);
int '''getLineStyle'''(QString name);
int '''getFillShade'''(QString name);
int '''getCornerRadius'''(QString name);
QList<QVariant> '''getImageScale'''(QString name);
QString '''getImageName'''(QString name);
 
QList<QVariant> '''getPosition'''(QString name);
QList<QVariant> '''getSize'''(QString name);
int '''getRotation'''(QString name);
QList<QVariant> '''getAllObjects'''();
 
==Page API==
==Color API==

Revision as of 12:02, 13 August 2011

Scripter2 API is described below. This is a reference for the actual documentation of new scripter.

The new Scripter is composed of different modules, which are either accessible externally, or via methods of other apis.

  • Scripter
  • Document API
  • Page API
  • Color API
  • Layer API
  • Printer API
  • PDF File API
  • Text API
  • Dialogs API
  • Preferences API
  • Window API