~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to libs/koreport/wrtembed/KoReportDesignerItemRectBase.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2010-10-27 17:52:57 UTC
  • mfrom: (0.12.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101027175257-s04zqqk5bs8ckm9o
Tags: 1:2.2.83-0ubuntu1
* Merge with Debian git remaining changes:
 - Add build-deps on librcps-dev, opengtl-dev, libqtgtl-dev, freetds-dev,
   create-resources, libspnav-dev
 - Remove needless build-dep on libwv2-dev
 - koffice-libs recommends create-resources
 - krita recommends pstoedit
 - Keep our patches
* New upstream release 2.3 beta 3
  - Remove debian/patches fixed by upstream
  - Update install files

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * OpenRPT report writer and rendering engine
 
3
 * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
 
4
 * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
 
5
 *
 
6
 * This library is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the GNU Lesser General Public
 
8
 * License as published by the Free Software Foundation; either
 
9
 * version 2.1 of the License, or (at your option) any later version.
 
10
 *
 
11
 * This library is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 
14
 * Lesser General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU Lesser General Public
 
17
 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 
18
 */
 
19
 
 
20
#ifndef REPORTRECTENTITY_H
 
21
#define REPORTRECTENTITY_H
 
22
 
 
23
#include <QGraphicsRectItem>
 
24
#include "KoReportDesignerItemBase.h"
 
25
#include <koproperty/Set.h>
 
26
#include <KoUnit.h>
 
27
#include "koreport_export.h"
 
28
 
 
29
class KoReportDesigner;
 
30
class KRPos;
 
31
class KRSize;
 
32
 
 
33
/**
 
34
 @author
 
35
*/
 
36
class KOREPORT_EXPORT KoReportDesignerItemRectBase : public QGraphicsRectItem, public KoReportDesignerItemBase
 
37
{
 
38
public:
 
39
    KoReportDesignerItemRectBase(KoReportDesigner*);
 
40
 
 
41
    virtual ~KoReportDesignerItemRectBase();
 
42
 
 
43
protected:
 
44
    void init(KRPos*, KRSize*, KoProperty::Set*);
 
45
    int m_dpiX;
 
46
    int m_dpiY;
 
47
 
 
48
    enum UpdatePropertyFlag {
 
49
        UpdateProperty,
 
50
        DontUpdateProperty
 
51
    };
 
52
 
 
53
    void setSceneRect(const QPointF& topLeft, const QSizeF& size, UpdatePropertyFlag update = UpdateProperty);
 
54
    void setSceneRect(const QRectF& rect, UpdatePropertyFlag update = UpdateProperty);
 
55
 
 
56
    void drawHandles(QPainter*);
 
57
    QRectF pointRect();
 
58
    QRectF sceneRect();
 
59
    virtual void mousePressEvent(QGraphicsSceneMouseEvent * event);
 
60
    virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent * event);
 
61
    virtual void mouseMoveEvent(QGraphicsSceneMouseEvent * event);
 
62
    virtual void hoverMoveEvent(QGraphicsSceneHoverEvent * event);
 
63
    virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
 
64
 
 
65
    void propertyChanged(const KoProperty::Set &s, const KoProperty::Property &p);
 
66
 
 
67
    virtual void move(const QPointF&);
 
68
private:
 
69
    int grabHandle(QPointF);
 
70
    int m_grabAction;
 
71
 
 
72
    KRPos* m_ppos;
 
73
    KRSize* m_psize;
 
74
    KoProperty::Set* m_pset;
 
75
 
 
76
};
 
77
 
 
78
#endif