1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox frontends: Qt GUI ("VirtualBox"):
|
---|
4 | * VirtualBox Qt extensions: QILabel class declaration
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2006-2008 Sun Microsystems, Inc.
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | *
|
---|
18 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
19 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
20 | * additional information or have any questions.
|
---|
21 | */
|
---|
22 |
|
---|
23 | /*
|
---|
24 | * This class is based on the original QLabel implementation.
|
---|
25 | */
|
---|
26 |
|
---|
27 | #ifndef __QILabel_h__
|
---|
28 | #define __QILabel_h__
|
---|
29 |
|
---|
30 | /* Qt includes */
|
---|
31 | #include <QWidget>
|
---|
32 |
|
---|
33 | class QILabelPrivate;
|
---|
34 |
|
---|
35 | class QILabel: public QWidget
|
---|
36 | {
|
---|
37 | Q_OBJECT;
|
---|
38 |
|
---|
39 | public:
|
---|
40 |
|
---|
41 | QILabel (QWidget *aParent = NULL, Qt::WindowFlags aFlags = 0);
|
---|
42 | QILabel (const QString &aText, QWidget *aParent = NULL, Qt::WindowFlags aFlags = 0);
|
---|
43 |
|
---|
44 | /* QLabel extensions */
|
---|
45 | bool fullSizeSelection () const;
|
---|
46 | void setFullSizeSelection (bool bOn);
|
---|
47 |
|
---|
48 | void updateSizeHint();
|
---|
49 |
|
---|
50 | /* Default QLabel methods */
|
---|
51 | Qt::Alignment alignment() const;
|
---|
52 | QWidget * buddy() const;
|
---|
53 | bool hasScaledContents() const;
|
---|
54 | int indent() const;
|
---|
55 | int margin() const;
|
---|
56 | QMovie *movie() const;
|
---|
57 | bool openExternalLinks() const;
|
---|
58 | const QPicture *picture() const;
|
---|
59 | const QPixmap *pixmap() const;
|
---|
60 | void setAlignment (Qt::Alignment aAlignment);
|
---|
61 | void setBuddy (QWidget *aBuddy);
|
---|
62 | void setIndent (int aIndent);
|
---|
63 | void setMargin (int aMargin);
|
---|
64 | void setOpenExternalLinks (bool aOpen);
|
---|
65 | void setScaledContents (bool aOn);
|
---|
66 | void setTextFormat (Qt::TextFormat aFormat);
|
---|
67 | void setTextInteractionFlags (Qt::TextInteractionFlags aFlags);
|
---|
68 | void setWordWrap (bool aOn);
|
---|
69 | QString text() const;
|
---|
70 | Qt::TextFormat textFormat() const;
|
---|
71 | Qt::TextInteractionFlags textInteractionFlags() const;
|
---|
72 | bool wordWrap() const;
|
---|
73 |
|
---|
74 | /* Default QWidget methods */
|
---|
75 | void setSizePolicy (QSizePolicy aPolicy);
|
---|
76 | void setMinimumSize (const QSize &aSize);
|
---|
77 |
|
---|
78 | public slots:
|
---|
79 |
|
---|
80 | void clear();
|
---|
81 | void setMovie (QMovie *aMovie);
|
---|
82 | void setNum (int aNum);
|
---|
83 | void setNum (double aNum);
|
---|
84 | void setPicture (const QPicture &aPicture);
|
---|
85 | void setPixmap (const QPixmap &aPixmap);
|
---|
86 | void setText (const QString &aText);
|
---|
87 |
|
---|
88 | signals:
|
---|
89 |
|
---|
90 | void linkActivated (const QString &);
|
---|
91 | void linkHovered (const QString &);
|
---|
92 |
|
---|
93 | protected:
|
---|
94 |
|
---|
95 | virtual void init();
|
---|
96 |
|
---|
97 | /* Protected member vars */
|
---|
98 | QILabelPrivate *mLabel;
|
---|
99 | };
|
---|
100 |
|
---|
101 | #endif // __QILabel_h__
|
---|
102 |
|
---|