~ubuntu-branches/ubuntu/quantal/kde-runtime/quantal

« back to all changes in this revision

Viewing changes to plasma/scriptengines/javascript/declarative/declarativeitemcontainer_p.h

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2012-06-03 21:50:00 UTC
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: package-import@ubuntu.com-20120603215000-vn7oarsq0ynrydj5
Tags: upstream-4.8.80
Import upstream version 4.8.80

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright 2011 Marco Martin <mart@kde.org>                            *
 
3
 *                                                                         *
 
4
 *   This program is free software; you can redistribute it and/or modify  *
 
5
 *   it under the terms of the GNU General Public License as published by  *
 
6
 *   the Free Software Foundation; either version 2 of the License, or     *
 
7
 *   (at your option) any later version.                                   *
 
8
 *                                                                         *
 
9
 *   This program is distributed in the hope that it will be useful,       *
 
10
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 
12
 *   GNU General Public License for more details.                          *
 
13
 *                                                                         *
 
14
 *   You should have received a copy of the GNU General Public License     *
 
15
 *   along with this program; if not, write to the                         *
 
16
 *   Free Software Foundation, Inc.,                                       *
 
17
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
 
18
 ***************************************************************************/
 
19
 
 
20
#ifndef DECLARATIVEITEMCONTAINER_P
 
21
#define DECLARATIVEITEMCONTAINER_P
 
22
 
 
23
#include <QDeclarativeItem>
 
24
#include <QGraphicsObject>
 
25
#include <QGraphicsWidget>
 
26
#include <QGraphicsSceneResizeEvent>
 
27
 
 
28
 
 
29
class DeclarativeItemContainer : public QGraphicsWidget
 
30
{
 
31
    Q_OBJECT
 
32
 
 
33
public:
 
34
    DeclarativeItemContainer(QGraphicsItem *parent = 0);
 
35
    ~DeclarativeItemContainer();
 
36
 
 
37
    void setDeclarativeItem(QDeclarativeItem *item, bool reparent = true);
 
38
    QDeclarativeItem *declarativeItem() const;
 
39
 
 
40
protected:
 
41
    void resizeEvent(QGraphicsSceneResizeEvent *event);
 
42
    void mousePressEvent(QGraphicsSceneMouseEvent *event);
 
43
 
 
44
protected Q_SLOTS:
 
45
    void widthChanged();
 
46
    void heightChanged();
 
47
 
 
48
private:
 
49
    QWeakPointer<QDeclarativeItem> m_declarativeItem;
 
50
};
 
51
 
 
52
#endif