~ubuntu-branches/ubuntu/karmic/kst/karmic

« back to all changes in this revision

Viewing changes to kst/kst/kstviewarrow.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2006-06-30 19:11:30 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060630191130-acumuar75bz4puty
Tags: 1.2.1-1ubuntu1
Merge from debian unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
                               kstviewarrow.h
 
3
                             -------------------
 
4
    begin                : Jun 14, 2005
 
5
    copyright            : (C) 2005 The University of Toronto
 
6
    email                :
 
7
 ***************************************************************************/
 
8
 
 
9
/***************************************************************************
 
10
 *                                                                         *
 
11
 *   This program is free software; you can redistribute it and/or modify  *
 
12
 *   it under the terms of the GNU General Public License as published by  *
 
13
 *   the Free Software Foundation; either version 2 of the License, or     *
 
14
 *   (at your option) any later version.                                   *
 
15
 *                                                                         *
 
16
 ***************************************************************************/
 
17
 
 
18
#ifndef KSTVIEWARROW_H
 
19
#define KSTVIEWARROW_H
 
20
 
 
21
#include "kstviewline.h"
 
22
#include <qglobal.h>
 
23
 
 
24
class KstViewArrow;
 
25
typedef KstSharedPtr<KstViewArrow> KstViewArrowPtr;
 
26
 
 
27
class KstViewArrow : public KstViewLine {
 
28
  Q_OBJECT
 
29
  Q_PROPERTY(bool hasFromArrow READ hasFromArrow WRITE setHasFromArrow)
 
30
  Q_PROPERTY(bool hasToArrow READ hasToArrow WRITE setHasToArrow)
 
31
  Q_PROPERTY(double fromArrowScaling READ fromArrowScaling WRITE setFromArrowScaling)
 
32
  Q_PROPERTY(double toArrowScaling READ toArrowScaling WRITE setToArrowScaling)
 
33
      
 
34
  public:
 
35
    KstViewArrow();
 
36
    KstViewArrow(const QDomElement& e);
 
37
    ~KstViewArrow();
 
38
    
 
39
    QMap<QString, QVariant > widgetHints(const QString& propertyName) const;
 
40
 
 
41
    void paintSelf(KstPainter& p, const QRegion& bounds);
 
42
    void paintArrow(KstPainter& p, const QPoint& to, const QPoint &from, int w, double arrowScaling);
 
43
    // true if either end has an arrow 
 
44
    bool hasArrow() const;
 
45
    
 
46
    bool hasFromArrow() const;
 
47
    void setHasFromArrow(bool yes);
 
48
    bool hasToArrow() const;
 
49
    void setHasToArrow(bool yes);
 
50
    double fromArrowScaling() const;
 
51
    void setFromArrowScaling(double scaling);
 
52
    double toArrowScaling() const;
 
53
    void setToArrowScaling(double scaling);
 
54
    QRegion clipRegion();
 
55
 
 
56
  public:
 
57
    void save(QTextStream& ts, const QString& indent = QString::null);
 
58
    
 
59
  private:
 
60
    bool _hasFromArrow;
 
61
    bool _hasToArrow;
 
62
    double _fromArrowScaling;
 
63
    double _toArrowScaling;
 
64
    QRegion _myClipMask;
 
65
};
 
66
 
 
67
typedef KstObjectList<KstViewArrowPtr> KstViewArrowList;
 
68
 
 
69
 
 
70
#endif
 
71
// vim: ts=2 sw=2 et