~ubuntu-branches/ubuntu/maverick/datakiosk/maverick

« back to all changes in this revision

Viewing changes to src/src/dataclip.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2005-06-27 22:48:06 UTC
  • Revision ID: james.westby@ubuntu.com-20050627224806-8farkci1dc2onhbs
Tags: upstream-0.7
ImportĀ upstreamĀ versionĀ 0.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
*   Copyright (C) 2005 by Adam Treat                                      *
 
3
*   treat@kde.org                                                         *
 
4
*                                                                         *
 
5
*   This program is free software; you can redistribute it and/or modify  *
 
6
*   it under the terms of the GNU General Public License as published by  *
 
7
*   the Free Software Foundation; either version 2 of the License, or     *
 
8
*   (at your option) any later version.                                   *
 
9
*                                                                         *
 
10
***************************************************************************/
 
11
 
 
12
#ifndef DATACLIP_H
 
13
#define DATACLIP_H
 
14
 
 
15
#include <qframe.h>
 
16
 
 
17
class QGrid;
 
18
class QLabel;
 
19
class QPixmap;
 
20
class QPainter;
 
21
class QCheckBox;
 
22
class QPushButton;
 
23
 
 
24
class PlainButton : public QFrame
 
25
{
 
26
    Q_OBJECT
 
27
public:
 
28
    PlainButton( const QPixmap &icon, int frameStyle, QWidget *parent );
 
29
 
 
30
    virtual ~PlainButton();
 
31
 
 
32
signals:
 
33
    void clicked();
 
34
 
 
35
protected:
 
36
    virtual void mousePressEvent( QMouseEvent *ev );
 
37
    virtual void mouseReleaseEvent( QMouseEvent *ev );
 
38
 
 
39
private:
 
40
    QLabel *m_label;
 
41
    int m_frameStyle;
 
42
    QColor m_background;
 
43
};
 
44
 
 
45
class CopyItem : public PlainButton
 
46
{
 
47
    Q_OBJECT
 
48
public:
 
49
    CopyItem( QWidget *parent, const QString &text );
 
50
 
 
51
    virtual ~CopyItem();
 
52
 
 
53
public:
 
54
    QString text() const;
 
55
 
 
56
public slots:
 
57
    void setText( const QString &text );
 
58
    void paste();
 
59
 
 
60
private:
 
61
    QString m_text;
 
62
};
 
63
 
 
64
class DataClip : public QFrame
 
65
{
 
66
    Q_OBJECT
 
67
public:
 
68
    DataClip( QWidget *parent );
 
69
 
 
70
    virtual ~DataClip();
 
71
 
 
72
private slots:
 
73
    void appendCopy();
 
74
    void clear();
 
75
 
 
76
private:
 
77
    QGrid *m_grid;
 
78
    QValueList<CopyItem *> m_copies;
 
79
};
 
80
 
 
81
class TitleBar : public QFrame
 
82
{
 
83
    Q_OBJECT
 
84
public:
 
85
    TitleBar( QWidget *parent, DataClip *clip );
 
86
 
 
87
    virtual ~TitleBar();
 
88
 
 
89
protected:
 
90
    virtual void mousePressEvent( QMouseEvent *ev );
 
91
    virtual void mouseMoveEvent( QMouseEvent * ev );
 
92
 
 
93
private slots:
 
94
    void close();
 
95
 
 
96
private:
 
97
    int m_x;
 
98
    int m_y;
 
99
    DataClip *m_clip;
 
100
    QCheckBox *m_close;
 
101
};
 
102
 
 
103
#endif