16 #ifndef _TEXT_LAYER_H_ 17 #define _TEXT_LAYER_H_ 20 #include "data/model/TextModel.h" 59 virtual void copy(
View *v, Selection s, Clipboard &to);
60 virtual bool paste(
View *v,
const Clipboard &from,
int frameOffset,
72 int *min,
int *max,
int *deflt)
const;
75 virtual void setProperty(
const PropertyName &,
int value);
84 bool &logarithmic, QString &unit)
const;
88 virtual void toXml(QTextStream &stream, QString indent =
"",
89 QString extraAttributes =
"")
const;
110 void finish(TextModel::EditCommand *command) {
111 Command *c = command->finish();
virtual void drawStart(View *v, QMouseEvent *)
virtual void paint(View *v, QPainter &paint, QRect rect) const
Paint the given rectangle of this layer onto the given view using the given painter,...
virtual void deleteSelection(Selection s)
TextModel::Point m_editingPoint
virtual void drawEnd(View *v, QMouseEvent *)
TextModel::Point m_originalPoint
bool getPointToDrag(View *v, int x, int y, TextModel::Point &) const
virtual const Model * getModel() const
void setProperties(const QXmlAttributes &attributes)
Set the particular properties of a layer (those specific to the subclass) from a set of XML attribute...
void setModel(TextModel *model)
virtual int getVerticalScaleWidth(View *, bool, QPainter &) const
void addCommand(Command *command)
Add a command to the command history.
virtual bool getValueExtents(float &min, float &max, bool &logarithmic, QString &unit) const
Return the minimum and maximum values for the y axis of the model in this layer, as well as whether t...
virtual QString getPropertyValueLabel(const PropertyName &, int value) const
virtual bool isLayerEditable() const
This should return true if the layer can be edited by the user.
void finish(TextModel::EditCommand *command)
virtual void eraseStart(View *v, QMouseEvent *)
virtual PropertyList getProperties() const
virtual void eraseDrag(View *v, QMouseEvent *)
virtual void editStart(View *v, QMouseEvent *)
virtual void editDrag(View *v, QMouseEvent *)
TextModel::PointList getLocalPoints(View *v, int x, int y) const
virtual int getCompletion(View *) const
Return the proportion of background work complete in drawing this view, as a percentage – in most cas...
virtual void setProperty(const PropertyName &, int value)
virtual bool snapToFeatureFrame(View *v, int &frame, int &resolution, SnapType snap) const
!! too much overlap with TimeValueLayer/TimeInstantLayer
virtual int getPropertyRangeAndValue(const PropertyName &, int *min, int *max, int *deflt) const
virtual void editEnd(View *v, QMouseEvent *)
static CommandHistory * getInstance()
virtual void copy(View *v, Selection s, Clipboard &to)
int getYForHeight(View *v, float height) const
virtual PropertyType getPropertyType(const PropertyName &) const
virtual bool editOpen(View *, QMouseEvent *)
Open an editor on the item under the mouse (e.g.
virtual int getDefaultColourHint(bool dark, bool &impose)
virtual void eraseEnd(View *v, QMouseEvent *)
virtual void drawDrag(View *v, QMouseEvent *)
View is the base class of widgets that display one or more overlaid views of data against a horizonta...
virtual void moveSelection(Selection s, int newStartFrame)
virtual bool isLayerScrollable(const View *v) const
This should return true if the layer can safely be scrolled automatically by a given view (simply cop...
float getHeightForY(View *v, int y) const
virtual void resizeSelection(Selection s, Selection newSize)
virtual void toXml(QTextStream &stream, QString indent="", QString extraAttributes="") const
Convert the layer's data (though not those of the model it refers to) into XML for file output.
TextModel::EditCommand * m_editingCommand
virtual QString getFeatureDescription(View *v, QPoint &) const
virtual QString getPropertyLabel(const PropertyName &) const
virtual bool paste(View *v, const Clipboard &from, int frameOffset, bool interactive)
Paste from the given clipboard onto the layer at the given frame offset.