columnMarkers Class Reference

The JavaScript class for using XSheet column markers. Obtain it by calling columnMarkers from the column global object. More...

Public Slots

int createMarker (int startFrame, int length, String &type)
 Creates a new marker on the current column and returns an ID to further manipulate it. More...
 
bool removeMarker (int id)
 
QScriptValue markers ()
 
QScriptValue markers (int startFrame)
 Returns an array containing all the marker IDs at the requested frame. More...
 
int marker (int startFrame, String &type)
 Gets a marker ID from the requested frame, of the given type, if there is one. More...
 
int startFrame (int markerId)
 Return the start frame of a given marker. More...
 
int length (int markerId)
 Queries the length of a column marker. More...
 
void moveMarker (int markerId, int newStart, int newLength)
 Moves a marker around on the same column and potentially change its length. More...
 
QScriptValue overlapingMarkers (int startFrame)
 Looks up all the markers that would overlap with the requested frame. More...
 

Data access.

QScriptValue value (int markerId, String &propertyName)
 Gets a property value given its key from the list of key/value pairs. More...
 
void setValue (int markerId, String &propertyName, QVariant &value)
 Sets a key/value pair on the given marker. More...
 
QScriptValue keyValues (int markerId)
 Returns the array of property keys that the marker contains. More...
 

Detailed Description

The JavaScript class for using XSheet column markers. Obtain it by calling columnMarkers from the column global object.

Column marker allows access to markers attached to a column.

Here is an example on how to add an inbetween marker in the first cell column at frame 3, of length 1 (Japanese timesheet):

var nbCols = column.numberOf();
if (nbCols == 0)
return;
var columnName = column.getName(0);
var markers = column.columnMarkers(columnName);
var markerId = markers.createMarker(3, 1,"com.toonboom.timesheet.actioninbetween");
markers.setValue(markerId, "MyKey", 1000);
var valueEquelTo1000 = markers.value(markerId, "MyKey");

Member Function Documentation

◆ createMarker

int columnMarkers::createMarker ( int  startFrame,
int  length,
String &  type 
)
slot

Creates a new marker on the current column and returns an ID to further manipulate it.

Parameters
startFrameWhich frame the marker will start on.
lengthLength of the new marker.
typeUser-customizable string determining the functionality of the marker.
Returns
int ID of the new marker.

◆ keyValues

QScriptValue columnMarkers::keyValues ( int  markerId)
slot

Returns the array of property keys that the marker contains.

Parameters
markerIdMarker to query.
Returns
Array containing all the keys available in the marker's list of key/value pairs.

◆ length

int columnMarkers::length ( int  markerId)
slot

Queries the length of a column marker.

Parameters
markerIdId of the marker which we want to know the length.
Returns
int Length of the marker.

◆ marker

int columnMarkers::marker ( int  startFrame,
String &  type 
)
slot

Gets a marker ID from the requested frame, of the given type, if there is one.

Parameters
startFrameFrame where to look for a marker.
typeSpecific marker type looked for.
Returns
int Marker ID. 0 if not found.

◆ markers [1/2]

QScriptValue columnMarkers::markers ( )
slot

Returns the IDs of all markers in the column managed by this marker manager.

Returns
Array containing the IDs of all the markers managed by this marker manager.

◆ markers [2/2]

QScriptValue columnMarkers::markers ( int  startFrame)
slot

Returns an array containing all the marker IDs at the requested frame.

Parameters
startFrameRequested frame.
Returns
Array containing all the marker IDs at the requested frame.

◆ moveMarker

void columnMarkers::moveMarker ( int  markerId,
int  newStart,
int  newLength 
)
slot

Moves a marker around on the same column and potentially change its length.

Parameters
markerIdID of the marker to move.
newStartNew starting frame.
newLengthNew length of the marker.

◆ overlapingMarkers

QScriptValue columnMarkers::overlapingMarkers ( int  startFrame)
slot

Looks up all the markers that would overlap with the requested frame.

Returns
Returns the list of marker IDs that overlap startFrame.

◆ removeMarker

bool columnMarkers::removeMarker ( int  id)
slot

Deletes the requested marker ID.

Parameters
idID of the marker to delete.
Returns
true when the deletion succeeds.
false if the id could not be found.

◆ setValue

void columnMarkers::setValue ( int  markerId,
String &  propertyName,
QVariant &  value 
)
slot

Sets a key/value pair on the given marker.

If a pair with the same key already exists it is updated with the new value.

Parameters
markerIdMarker to manipulate.
propertyNameKey of the value to set.
valueValue to set in the key/value pair.

◆ startFrame

int columnMarkers::startFrame ( int  markerId)
slot

Return the start frame of a given marker.

Parameters
markerIdID of the queried marker.
Returns
int Starting frame of the requested marker.

◆ value

QScriptValue columnMarkers::value ( int  markerId,
String &  propertyName 
)
slot

Gets a property value given its key from the list of key/value pairs.

Returns a null value if the property does not exist (which is different from returning an empty QVariant; we could still set an empty value to a property value.)

Parameters
markerIdMarker to query.
propertyNameKey to query from the marker.
Returns
Object stored in the marker at the given key.