Now compiles all of kdelibs/dcop, kdelibs/kdecore/svgicons, and kdelibs/kdecore/network git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/dependencies/tqtinterface@1159658 283d02a7-25f6-0310-bc7c-ecb5cbfe19dav3.5.13-sru
parent
c9dc390776
commit
15c45c7b59
@ -0,0 +1,125 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the Qt3Support module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial Usage
|
||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||
** accordance with the Qt Commercial License Agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Nokia.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3.0 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU General Public License version 3.0 requirements will be
|
||||
** met: http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at qt-info@nokia.com.
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef Q3PAINTER_H
|
||||
#define Q3PAINTER_H
|
||||
|
||||
#include <QtGui/qpainter.h>
|
||||
|
||||
QT_BEGIN_HEADER
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QT_MODULE(Qt3SupportLight)
|
||||
|
||||
class Q_COMPAT_EXPORT Q3Painter : public QPainter
|
||||
{
|
||||
public:
|
||||
Q3Painter() : QPainter() { }
|
||||
Q3Painter(QPaintDevice *pdev) : QPainter(pdev) { }
|
||||
|
||||
inline void drawRect(const QRect &rect);
|
||||
inline void drawRect(int x1, int y1, int w, int h)
|
||||
{ drawRect(QRect(x1, y1, w, h)); }
|
||||
|
||||
inline void drawRoundRect(const QRect &r, int xround = 25, int yround = 25);
|
||||
inline void drawRoundRect(int x, int y, int w, int h, int xround = 25, int yround = 25)
|
||||
{ drawRoundRect(QRect(x, y, w, h), xround, yround); }
|
||||
|
||||
inline void drawEllipse(const QRect &r);
|
||||
inline void drawEllipse(int x, int y, int w, int h)
|
||||
{ drawEllipse(QRect(x, y, w, h)); }
|
||||
|
||||
inline void drawArc(const QRect &r, int a, int alen);
|
||||
inline void drawArc(int x, int y, int w, int h, int a, int alen)
|
||||
{ drawArc(QRect(x, y, w, h), a, alen); }
|
||||
|
||||
inline void drawPie(const QRect &r, int a, int alen);
|
||||
inline void drawPie(int x, int y, int w, int h, int a, int alen)
|
||||
{ drawPie(QRect(x, y, w, h), a, alen); }
|
||||
|
||||
inline void drawChord(const QRect &r, int a, int alen);
|
||||
inline void drawChord(int x, int y, int w, int h, int a, int alen)
|
||||
{ drawChord(QRect(x, y, w, h), a, alen); }
|
||||
|
||||
void setRasterOp( Qt::RasterOp );
|
||||
|
||||
private:
|
||||
QRect adjustedRectangle(const QRect &r);
|
||||
|
||||
Q_DISABLE_COPY(Q3Painter)
|
||||
};
|
||||
|
||||
void inline Q3Painter::drawRect(const QRect &r)
|
||||
{
|
||||
QPainter::drawRect(adjustedRectangle(r));
|
||||
}
|
||||
|
||||
void inline Q3Painter::drawEllipse(const QRect &r)
|
||||
{
|
||||
QPainter::drawEllipse(adjustedRectangle(r));
|
||||
}
|
||||
|
||||
void inline Q3Painter::drawRoundRect(const QRect &r, int xrnd, int yrnd)
|
||||
{
|
||||
QPainter::drawRoundRect(adjustedRectangle(r), xrnd, yrnd);
|
||||
}
|
||||
|
||||
void inline Q3Painter::drawArc(const QRect &r, int angle, int arcLength)
|
||||
{
|
||||
QPainter::drawArc(adjustedRectangle(r), angle, arcLength);
|
||||
}
|
||||
|
||||
void inline Q3Painter::drawPie(const QRect &r, int angle, int arcLength)
|
||||
{
|
||||
QPainter::drawPie(adjustedRectangle(r), angle, arcLength);
|
||||
}
|
||||
|
||||
void inline Q3Painter::drawChord(const QRect &r, int angle, int arcLength)
|
||||
{
|
||||
QPainter::drawChord(adjustedRectangle(r), angle, arcLength);
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
QT_END_HEADER
|
||||
|
||||
#endif // Q3PAINTER_H
|
@ -0,0 +1,399 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the QtCore module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial Usage
|
||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||
** accordance with the Qt Commercial License Agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Nokia.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3.0 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU General Public License version 3.0 requirements will be
|
||||
** met: http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at qt-info@nokia.com.
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QCHAR_H
|
||||
#define QCHAR_H
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
QT_BEGIN_HEADER
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QT_MODULE(Core)
|
||||
|
||||
class QString;
|
||||
|
||||
struct QLatin1Char
|
||||
{
|
||||
public:
|
||||
inline explicit QLatin1Char(char c) : ch(c) {}
|
||||
#ifdef Q_COMPILER_MANGLES_RETURN_TYPE
|
||||
inline const char toLatin1() const { return ch; }
|
||||
inline const ushort unicode() const { return ushort(uchar(ch)); }
|
||||
#else
|
||||
inline char toLatin1() const { return ch; }
|
||||
inline ushort unicode() const { return ushort(uchar(ch)); }
|
||||
#endif
|
||||
|
||||
private:
|
||||
char ch;
|
||||
};
|
||||
|
||||
|
||||
class Q_CORE_EXPORT QChar {
|
||||
public:
|
||||
QChar();
|
||||
#ifndef QT_NO_CAST_FROM_ASCII
|
||||
QT_ASCII_CAST_WARN_CONSTRUCTOR QChar(char c);
|
||||
QT_ASCII_CAST_WARN_CONSTRUCTOR QChar(uchar c);
|
||||
#endif
|
||||
QChar(QLatin1Char ch);
|
||||
QChar(uchar c, uchar r);
|
||||
inline QChar(ushort rc) : ucs(rc){}
|
||||
QChar(short rc);
|
||||
QChar(uint rc);
|
||||
QChar(int rc);
|
||||
enum SpecialCharacter {
|
||||
Null = 0x0000,
|
||||
Nbsp = 0x00a0,
|
||||
ReplacementCharacter = 0xfffd,
|
||||
ObjectReplacementCharacter = 0xfffc,
|
||||
ByteOrderMark = 0xfeff,
|
||||
ByteOrderSwapped = 0xfffe,
|
||||
#ifdef QT3_SUPPORT
|
||||
null = Null,
|
||||
replacement = ReplacementCharacter,
|
||||
byteOrderMark = ByteOrderMark,
|
||||
byteOrderSwapped = ByteOrderSwapped,
|
||||
nbsp = Nbsp,
|
||||
#endif
|
||||
ParagraphSeparator = 0x2029,
|
||||
LineSeparator = 0x2028
|
||||
};
|
||||
QChar(SpecialCharacter sc);
|
||||
|
||||
// Unicode information
|
||||
|
||||
enum Category
|
||||
{
|
||||
NoCategory,
|
||||
|
||||
Mark_NonSpacing, // Mn
|
||||
Mark_SpacingCombining, // Mc
|
||||
Mark_Enclosing, // Me
|
||||
|
||||
Number_DecimalDigit, // Nd
|
||||
Number_Letter, // Nl
|
||||
Number_Other, // No
|
||||
|
||||
Separator_Space, // Zs
|
||||
Separator_Line, // Zl
|
||||
Separator_Paragraph, // Zp
|
||||
|
||||
Other_Control, // Cc
|
||||
Other_Format, // Cf
|
||||
Other_Surrogate, // Cs
|
||||
Other_PrivateUse, // Co
|
||||
Other_NotAssigned, // Cn
|
||||
|
||||
Letter_Uppercase, // Lu
|
||||
Letter_Lowercase, // Ll
|
||||
Letter_Titlecase, // Lt
|
||||
Letter_Modifier, // Lm
|
||||
Letter_Other, // Lo
|
||||
|
||||
Punctuation_Connector, // Pc
|
||||
Punctuation_Dash, // Pd
|
||||
Punctuation_Open, // Ps
|
||||
Punctuation_Close, // Pe
|
||||
Punctuation_InitialQuote, // Pi
|
||||
Punctuation_FinalQuote, // Pf
|
||||
Punctuation_Other, // Po
|
||||
|
||||
Symbol_Math, // Sm
|
||||
Symbol_Currency, // Sc
|
||||
Symbol_Modifier, // Sk
|
||||
Symbol_Other, // So
|
||||
|
||||
Punctuation_Dask = Punctuation_Dash // oops
|
||||
};
|
||||
|
||||
enum Direction
|
||||
{
|
||||
DirL, DirR, DirEN, DirES, DirET, DirAN, DirCS, DirB, DirS, DirWS, DirON,
|
||||
DirLRE, DirLRO, DirAL, DirRLE, DirRLO, DirPDF, DirNSM, DirBN
|
||||
};
|
||||
|
||||
enum Decomposition
|
||||
{
|
||||
NoDecomposition,
|
||||
Canonical,
|
||||
Font,
|
||||
NoBreak,
|
||||
Initial,
|
||||
Medial,
|
||||
Final,
|
||||
Isolated,
|
||||
Circle,
|
||||
Super,
|
||||
Sub,
|
||||
Vertical,
|
||||
Wide,
|
||||
Narrow,
|
||||
Small,
|
||||
Square,
|
||||
Compat,
|
||||
Fraction
|
||||
|
||||
#ifdef QT3_SUPPORT
|
||||
, Single = NoDecomposition
|
||||
#endif
|
||||
};
|
||||
|
||||
enum Joining
|
||||
{
|
||||
OtherJoining, Dual, Right, Center
|
||||
};
|
||||
|
||||
enum CombiningClass
|
||||
{
|
||||
Combining_BelowLeftAttached = 200,
|
||||
Combining_BelowAttached = 202,
|
||||
Combining_BelowRightAttached = 204,
|
||||
Combining_LeftAttached = 208,
|
||||
Combining_RightAttached = 210,
|
||||
Combining_AboveLeftAttached = 212,
|
||||
Combining_AboveAttached = 214,
|
||||
Combining_AboveRightAttached = 216,
|
||||
|
||||
Combining_BelowLeft = 218,
|
||||
Combining_Below = 220,
|
||||
Combining_BelowRight = 222,
|
||||
Combining_Left = 224,
|
||||
Combining_Right = 226,
|
||||
Combining_AboveLeft = 228,
|
||||
Combining_Above = 230,
|
||||
Combining_AboveRight = 232,
|
||||
|
||||
Combining_DoubleBelow = 233,
|
||||
Combining_DoubleAbove = 234,
|
||||
Combining_IotaSubscript = 240
|
||||
};
|
||||
|
||||
enum UnicodeVersion {
|
||||
Unicode_Unassigned,
|
||||
Unicode_1_1,
|
||||
Unicode_2_0,
|
||||
Unicode_2_1_2,
|
||||
Unicode_3_0,
|
||||
Unicode_3_1,
|
||||
Unicode_3_2,
|
||||
Unicode_4_0,
|
||||
Unicode_4_1,
|
||||
Unicode_5_0
|
||||
};
|
||||
// ****** WHEN ADDING FUNCTIONS, CONSIDER ADDING TO QCharRef TOO
|
||||
|
||||
Category category() const;
|
||||
Direction direction() const;
|
||||
Joining joining() const;
|
||||
bool hasMirrored() const;
|
||||
unsigned char combiningClass() const;
|
||||
|
||||
QChar mirroredChar() const;
|
||||
QString decomposition() const;
|
||||
Decomposition decompositionTag() const;
|
||||
|
||||
int digitValue() const;
|
||||
QChar toLower() const;
|
||||
QChar toUpper() const;
|
||||
QChar toTitleCase() const;
|
||||
QChar toCaseFolded() const;
|
||||
|
||||
UnicodeVersion unicodeVersion() const;
|
||||
|
||||
#ifdef Q_COMPILER_MANGLES_RETURN_TYPE
|
||||
const char toAscii() const;
|
||||
inline const char toLatin1() const;
|
||||
inline const ushort unicode() const { return ucs; }
|
||||
#else
|
||||
char toAscii() const;
|
||||
inline char toLatin1() const;
|
||||
inline ushort unicode() const { return ucs; }
|
||||
#endif
|
||||
#ifdef Q_NO_PACKED_REFERENCE
|
||||
inline ushort &unicode() { return const_cast<ushort&>(ucs); }
|
||||
#else
|
||||
inline ushort &unicode() { return ucs; }
|
||||
#endif
|
||||
|
||||
static QChar fromAscii(char c);
|
||||
static QChar fromLatin1(char c);
|
||||
|
||||
inline bool isNull() const { return ucs == 0; }
|
||||
bool isPrint() const;
|
||||
bool isPunct() const;
|
||||
bool isSpace() const;
|
||||
bool isMark() const;
|
||||
bool isLetter() const;
|
||||
bool isNumber() const;
|
||||
bool isLetterOrNumber() const;
|
||||
bool isDigit() const;
|
||||
bool isSymbol() const;
|
||||
inline bool isLower() const { return category() == Letter_Lowercase; }
|
||||
inline bool isUpper() const { return category() == Letter_Uppercase; }
|
||||
inline bool isTitleCase() const { return category() == Letter_Titlecase; }
|
||||
|
||||
inline bool isHighSurrogate() const {
|
||||
return ((ucs & 0xfc00) == 0xd800);
|
||||
}
|
||||
inline bool isLowSurrogate() const {
|
||||
return ((ucs & 0xfc00) == 0xdc00);
|
||||
}
|
||||
|
||||
inline uchar cell() const { return uchar(ucs & 0xff); }
|
||||
inline uchar row() const { return uchar((ucs>>8)&0xff); }
|
||||
inline void setCell(uchar cell);
|
||||
inline void setRow(uchar row);
|
||||
|
||||
static inline uint surrogateToUcs4(ushort high, ushort low) {
|
||||
return (uint(high)<<10) + low - 0x35fdc00;
|
||||
}
|
||||
static inline uint surrogateToUcs4(QChar high, QChar low) {
|
||||
return (uint(high.ucs)<<10) + low.ucs - 0x35fdc00;
|
||||
}
|
||||
static inline ushort highSurrogate(uint ucs4) {
|
||||
return ushort((ucs4>>10) + 0xd7c0);
|
||||
}
|
||||
static inline ushort lowSurrogate(uint ucs4) {
|
||||
return ushort(ucs4%0x400 + 0xdc00);
|
||||
}
|
||||
|
||||
static Category QT_FASTCALL category(uint ucs4);
|
||||
static Category QT_FASTCALL category(ushort ucs2);
|
||||
static Direction QT_FASTCALL direction(uint ucs4);
|
||||
static Direction QT_FASTCALL direction(ushort ucs2);
|
||||
static Joining QT_FASTCALL joining(uint ucs4);
|
||||
static Joining QT_FASTCALL joining(ushort ucs2);
|
||||
static unsigned char QT_FASTCALL combiningClass(uint ucs4);
|
||||
static unsigned char QT_FASTCALL combiningClass(ushort ucs2);
|
||||
|
||||
static uint QT_FASTCALL mirroredChar(uint ucs4);
|
||||
static ushort QT_FASTCALL mirroredChar(ushort ucs2);
|
||||
static Decomposition QT_FASTCALL decompositionTag(uint ucs4);
|
||||
|
||||
static int QT_FASTCALL digitValue(uint ucs4);
|
||||
static int QT_FASTCALL digitValue(ushort ucs2);
|
||||
static uint QT_FASTCALL toLower(uint ucs4);
|
||||
static ushort QT_FASTCALL toLower(ushort ucs2);
|
||||
static uint QT_FASTCALL toUpper(uint ucs4);
|
||||
static ushort QT_FASTCALL toUpper(ushort ucs2);
|
||||
static uint QT_FASTCALL toTitleCase(uint ucs4);
|
||||
static ushort QT_FASTCALL toTitleCase(ushort ucs2);
|
||||
static uint QT_FASTCALL toCaseFolded(uint ucs4);
|
||||
static ushort QT_FASTCALL toCaseFolded(ushort ucs2);
|
||||
|
||||
static UnicodeVersion QT_FASTCALL unicodeVersion(uint ucs4);
|
||||
static UnicodeVersion QT_FASTCALL unicodeVersion(ushort ucs2);
|
||||
|
||||
static QString QT_FASTCALL decomposition(uint ucs4);
|
||||
|
||||
#ifdef QT3_SUPPORT
|
||||
inline QT3_SUPPORT bool mirrored() const { return hasMirrored(); }
|
||||
inline QT3_SUPPORT QChar lower() const { return toLower(); }
|
||||
inline QT3_SUPPORT QChar upper() const { return toUpper(); }
|
||||
static inline QT3_SUPPORT bool networkOrdered() {
|
||||
return QSysInfo::ByteOrder == QSysInfo::BigEndian;
|
||||
}
|
||||
#ifdef Q_COMPILER_MANGLES_RETURN_TYPE
|
||||
inline QT3_SUPPORT const char latin1() const { return toLatin1(); }
|
||||
inline QT3_SUPPORT const char ascii() const { return toAscii(); }
|
||||
#else
|
||||
inline QT3_SUPPORT char latin1() const { return toLatin1(); }
|
||||
inline QT3_SUPPORT char ascii() const { return toAscii(); }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
operator int () const;
|
||||
|
||||
private:
|
||||
#ifdef QT_NO_CAST_FROM_ASCII
|
||||
QChar(char c);
|
||||
QChar(uchar c);
|
||||
#endif
|
||||
ushort ucs;
|
||||
}
|
||||
#if (defined(__arm__) || defined(__ARMEL__))
|
||||
Q_PACKED
|
||||
#endif
|
||||
;
|
||||
|
||||
Q_DECLARE_TYPEINFO(QChar, Q_MOVABLE_TYPE);
|
||||
|
||||
inline QChar::QChar() : ucs(0) {}
|
||||
|
||||
#ifdef Q_COMPILER_MANGLES_RETURN_TYPE
|
||||
inline const char QChar::toLatin1() const { return ucs > 0xff ? '\0' : char(ucs); }
|
||||
#else
|
||||
inline char QChar::toLatin1() const { return ucs > 0xff ? '\0' : char(ucs); }
|
||||
#endif
|
||||
inline QChar QChar::fromLatin1(char c) { return QChar(ushort(uchar(c))); }
|
||||
|
||||
inline QChar::QChar(uchar c, uchar r) : ucs(ushort((r << 8) | c)){}
|
||||
inline QChar::QChar(short rc) : ucs(ushort(rc)){}
|
||||
inline QChar::QChar(uint rc) : ucs(ushort(rc & 0xffff)){}
|
||||
inline QChar::QChar(int rc) : ucs(ushort(rc & 0xffff)){}
|
||||
inline QChar::QChar(SpecialCharacter s) : ucs(ushort(s)) {}
|
||||
inline QChar::QChar(QLatin1Char ch) : ucs(ch.unicode()) {}
|
||||
|
||||
inline void QChar::setCell(uchar acell)
|
||||
{ ucs = ushort((ucs & 0xff00) + acell); }
|
||||
inline void QChar::setRow(uchar arow)
|
||||
{ ucs = ushort((ushort(arow)<<8) + (ucs&0xff)); }
|
||||
|
||||
inline bool operator==(QChar c1, QChar c2) { return c1.unicode() == c2.unicode(); }
|
||||
inline bool operator!=(QChar c1, QChar c2) { return c1.unicode() != c2.unicode(); }
|
||||
inline bool operator<=(QChar c1, QChar c2) { return c1.unicode() <= c2.unicode(); }
|
||||
inline bool operator>=(QChar c1, QChar c2) { return c1.unicode() >= c2.unicode(); }
|
||||
inline bool operator<(QChar c1, QChar c2) { return c1.unicode() < c2.unicode(); }
|
||||
inline bool operator>(QChar c1, QChar c2) { return c1.unicode() > c2.unicode(); }
|
||||
|
||||
#ifndef QT_NO_DATASTREAM
|
||||
Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QChar &);
|
||||
Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QChar &);
|
||||
#endif
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
QT_END_HEADER
|
||||
|
||||
#endif // QCHAR_H
|
@ -0,0 +1,151 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the QtGui module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial Usage
|
||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||
** accordance with the Qt Commercial License Agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Nokia.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3.0 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU General Public License version 3.0 requirements will be
|
||||
** met: http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at qt-info@nokia.com.
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QCOMMONSTYLE_H
|
||||
#define QCOMMONSTYLE_H
|
||||
|
||||
#include <QtGui/qstyle.h>
|
||||
#include <QtGui/qstyleoption.h>
|
||||
|
||||
class Q3Painter;
|
||||
|
||||
QT_BEGIN_HEADER
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
QT_MODULE(Gui)
|
||||
|
||||
class QCommonStylePrivate;
|
||||
|
||||
class Q_GUI_EXPORT QCommonStyle: public QStyle
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QCommonStyle();
|
||||
~QCommonStyle();
|
||||
|
||||
void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p,
|
||||
const QWidget *w = 0) const;
|
||||
// void drawPrimitive(ControlElement element, const QStyleOption *opt, QPainter *p,
|
||||
// const QWidget *w = 0) const;
|
||||
void drawPrimitive( PrimitiveElement pe,
|
||||
Q3Painter *p,
|
||||
const QRect &r,
|
||||
const QColorGroup &cg,
|
||||
SFlags flags = State_Default,
|
||||
const QStyleOption& = QStyleOption::SO_Default ) const;
|
||||
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p,
|
||||
const QWidget *w = 0) const;
|
||||
void drawControl( ControlElement element,
|
||||
Q3Painter *p,
|
||||
const QWidget *widget,
|
||||
const QRect &r,
|
||||
const QColorGroup &cg,
|
||||
SFlags how = State_Default,
|
||||
const QStyleOption& = QStyleOption::SO_Default ) const;
|
||||
QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget = 0) const;
|
||||
QRect subRect( SubElement r, const QWidget *widget ) const;
|
||||
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p,
|
||||
const QWidget *w = 0) const;
|
||||
void drawComplexControl( ComplexControl control,
|
||||
Q3Painter *p,
|
||||
const QWidget *widget,
|
||||
const QRect &r,
|
||||
const QColorGroup &cg,
|
||||
SFlags how = State_Default,
|
||||
SCFlags sub = SC_All,
|
||||
SCFlags subActive = SC_None,
|
||||
const QStyleOption& = QStyleOption::SO_Default ) const;
|
||||
SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt,
|
||||
const QPoint &pt, const QWidget *w = 0) const;
|
||||
SubControl querySubControl( ComplexControl control,
|
||||
const QWidget *widget,
|
||||
const QPoint &pos,
|
||||
const QStyleOption& = QStyleOption::SO_Default ) const;
|
||||
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc,
|
||||
const QWidget *w = 0) const;
|
||||
QRect querySubControlMetrics( ComplexControl control,
|
||||
const QWidget *widget,
|
||||
SubControl sc,
|
||||
const QStyleOption& = QStyleOption::SO_Default ) const;
|
||||
|
||||
QSize sizeFromContents(ContentsType ct, const QStyleOption *opt,
|
||||
const QSize &contentsSize, const QWidget *widget = 0) const;
|
||||
|
||||
int pixelMetric(PixelMetric m, const QStyleOption *opt = 0, const QWidget *widget = 0) const;
|
||||
int pixelMetric( PixelMetric m, const QWidget *widget = 0 ) const;
|
||||
|
||||
int styleHint(StyleHint sh, const QStyleOption *opt = 0, const QWidget *w = 0,
|
||||
QStyleHintReturn *shret = 0) const;
|
||||
int styleHint(StyleHint sh, const QWidget *, const QStyleOption &, QStyleHintReturn *) const;
|
||||
|
||||
QPixmap standardPixmap(StandardPixmap sp, const QStyleOption *opt = 0,
|
||||
const QWidget *widget = 0) const;
|
||||
QPixmap stylePixmap( StandardPixmap stylepixmap,
|
||||
const QWidget *widget = 0,
|
||||
const QStyleOption& = QStyleOption::SO_Default ) const;
|
||||
|
||||
QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap,
|
||||
const QStyleOption *opt) const;
|
||||
|
||||
void polish(QPalette &);
|
||||
void polish(QApplication *app);
|
||||
void polish(QWidget *widget);
|
||||
void unpolish(QWidget *widget);
|
||||
void unpolish(QApplication *application);
|
||||
|
||||
protected Q_SLOTS:
|
||||
QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *opt = 0,
|
||||
const QWidget *widget = 0) const;
|
||||
|
||||
protected:
|
||||
QCommonStyle(QCommonStylePrivate &dd);
|
||||
|
||||
private:
|
||||
Q_DECLARE_PRIVATE(QCommonStyle)
|
||||
Q_DISABLE_COPY(QCommonStyle)
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
QT_END_HEADER
|
||||
|
||||
#endif // QCOMMONSTYLE_H
|
@ -0,0 +1,439 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the QtCore module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial Usage
|
||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||
** accordance with the Qt Commercial License Agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Nokia.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3.0 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU General Public License version 3.0 requirements will be
|
||||
** met: http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at qt-info@nokia.com.
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QDATASTREAM_H
|
||||
#define QDATASTREAM_H
|
||||
|
||||
#include <QtCore/qscopedpointer.h>
|
||||
#include <QtCore/qiodevice.h>
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#ifdef Status
|
||||
#error qdatastream.h must be included before any header file that defines Status
|
||||
#endif
|
||||
|
||||
QT_BEGIN_HEADER
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QT_MODULE(Core)
|
||||
|
||||
class QByteArray;
|
||||
class QIODevice;
|
||||
|
||||
template <typename T> class QList;
|
||||
template <typename T> class QLinkedList;
|
||||
template <typename T> class QVector;
|
||||
template <typename T> class QSet;
|
||||
template <class Key, class T> class QHash;
|
||||
template <class Key, class T> class QMap;
|
||||
|
||||
#if !defined(QT_NO_DATASTREAM) || defined(QT_BOOTSTRAPPED)
|
||||
class QDataStreamPrivate;
|
||||
class Q_CORE_EXPORT QDataStream
|
||||
{
|
||||
public:
|
||||
enum Version {
|
||||
Qt_1_0 = 1,
|
||||
Qt_2_0 = 2,
|
||||
Qt_2_1 = 3,
|
||||
Qt_3_0 = 4,
|
||||
Qt_3_1 = 5,
|
||||
Qt_3_3 = 6,
|
||||
Qt_4_0 = 7,
|
||||
Qt_4_1 = Qt_4_0,
|
||||
Qt_4_2 = 8,
|
||||
Qt_4_3 = 9,
|
||||
Qt_4_4 = 10,
|
||||
Qt_4_5 = 11,
|
||||
Qt_4_6 = 12
|
||||
#if QT_VERSION >= 0x040700
|
||||
#error Add the datastream version for this Qt version
|
||||
Qt_4_7 = Qt_4_6
|
||||
#endif
|
||||
};
|
||||
|
||||
enum ByteOrder {
|
||||
BigEndian = QSysInfo::BigEndian,
|
||||
LittleEndian = QSysInfo::LittleEndian
|
||||
};
|
||||
|
||||
enum Status {
|
||||
Ok,
|
||||
ReadPastEnd,
|
||||
ReadCorruptData
|
||||
};
|
||||
|
||||
enum FloatingPointPrecision {
|
||||
SinglePrecision,
|
||||
DoublePrecision
|
||||
};
|
||||
|
||||
QDataStream();
|
||||
explicit QDataStream(QIODevice *);
|
||||
#ifdef QT3_SUPPORT
|
||||
QDataStream(QByteArray *, int mode);
|
||||
#endif
|
||||
QDataStream(QByteArray *, QIODevice::OpenMode flags);
|
||||
QDataStream(const QByteArray &);
|
||||
virtual ~QDataStream();
|
||||
|
||||
QIODevice *device() const;
|
||||
void setDevice(QIODevice *);
|
||||
void unsetDevice();
|
||||
|
||||
bool atEnd() const;
|
||||
#ifdef QT3_SUPPORT
|
||||
inline QT3_SUPPORT bool eof() const { return atEnd(); }
|
||||
#endif
|
||||
|
||||
Status status() const;
|
||||
void setStatus(Status status);
|
||||
void resetStatus();
|
||||
|
||||
FloatingPointPrecision floatingPointPrecision() const;
|
||||
void setFloatingPointPrecision(FloatingPointPrecision precision);
|
||||
|
||||
ByteOrder byteOrder() const;
|
||||
void setByteOrder(ByteOrder);
|
||||
|
||||
int version() const;
|
||||
void setVersion(int);
|
||||
|
||||
QDataStream &operator>>(qint8 &i);
|
||||
QDataStream &operator>>(quint8 &i);
|
||||
QDataStream &operator>>(qint16 &i);
|
||||
QDataStream &operator>>(quint16 &i);
|
||||
QDataStream &operator>>(qint32 &i);
|
||||
QDataStream &operator>>(quint32 &i);
|
||||
QDataStream &operator>>(qint64 &i);
|
||||
QDataStream &operator>>(quint64 &i);
|
||||
QDataStream &operator>>(bool &i);
|
||||
QDataStream &operator>>(float &f);
|
||||
QDataStream &operator>>(double &f);
|
||||
QDataStream &operator>>(char *&str);
|
||||
QDataStream &operator>>(long &i);
|
||||
QDataStream &operator>>(long unsigned int &i);
|
||||
|
||||
QDataStream &operator<<(qint8 i);
|
||||
QDataStream &operator<<(quint8 i);
|
||||
QDataStream &operator<<(qint16 i);
|
||||
QDataStream &operator<<(quint16 i);
|
||||
QDataStream &operator<<(qint32 i);
|
||||
QDataStream &operator<<(quint32 i);
|
||||
QDataStream &operator<<(qint64 i);
|
||||
QDataStream &operator<<(quint64 i);
|
||||
QDataStream &operator<<(bool i);
|
||||
QDataStream &operator<<(float f);
|
||||
QDataStream &operator<<(double f);
|
||||
QDataStream &operator<<(const char *str);
|
||||
QDataStream &operator<<(long i);
|
||||
QDataStream &operator<<(long unsigned int i);
|
||||
|
||||
QDataStream &readBytes(char *&, uint &len);
|
||||
int readRawData(char *, int len);
|
||||
|
||||
QDataStream &writeBytes(const char *, uint len);
|
||||
int writeRawData(const char *, int len);
|
||||
|
||||
int skipRawData(int len);
|
||||
|
||||
#ifdef QT3_SUPPORT
|
||||
inline QT3_SUPPORT QDataStream &readRawBytes(char *str, uint len)
|
||||
{ readRawData(str, static_cast<int>(len)); return *this; }
|
||||
inline QT3_SUPPORT QDataStream &writeRawBytes(const char *str, uint len)
|
||||
{ writeRawData(str, static_cast<int>(len)); return *this; }
|
||||
inline QT3_SUPPORT bool isPrintableData() const { return false; }
|
||||
inline QT3_SUPPORT void setPrintableData(bool) {}
|
||||
#endif
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(QDataStream)
|
||||
|
||||
QScopedPointer<QDataStreamPrivate> d;
|
||||
|
||||
QIODevice *dev;
|
||||
bool owndev;
|
||||
bool noswap;
|
||||
ByteOrder byteorder;
|
||||
int ver;
|
||||
Status q_status;
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
QDataStream inline functions
|
||||
*****************************************************************************/
|
||||
|
||||
inline QIODevice *QDataStream::device() const
|
||||
{ return dev; }
|
||||
|
||||
inline QDataStream::ByteOrder QDataStream::byteOrder() const
|
||||
{ return byteorder; }
|
||||
|
||||
inline int QDataStream::version() const
|
||||
{ return ver; }
|
||||
|
||||
inline void QDataStream::setVersion(int v)
|
||||
{ ver = v; }
|
||||
|
||||
inline QDataStream &QDataStream::operator>>(quint8 &i)
|
||||
{ return *this >> reinterpret_cast<qint8&>(i); }
|
||||
|
||||
inline QDataStream &QDataStream::operator>>(quint16 &i)
|
||||
{ return *this >> reinterpret_cast<qint16&>(i); }
|
||||
|
||||
inline QDataStream &QDataStream::operator>>(quint32 &i)
|
||||
{ return *this >> reinterpret_cast<qint32&>(i); }
|
||||
|
||||
inline QDataStream &QDataStream::operator>>(quint64 &i)
|
||||
{ return *this >> reinterpret_cast<qint64&>(i); }
|
||||
|
||||
inline QDataStream &QDataStream::operator<<(quint8 i)
|
||||
{ return *this << qint8(i); }
|
||||
|
||||
inline QDataStream &QDataStream::operator<<(quint16 i)
|
||||
{ return *this << qint16(i); }
|
||||
|
||||
inline QDataStream &QDataStream::operator<<(quint32 i)
|
||||
{ return *this << qint32(i); }
|
||||
|
||||
inline QDataStream &QDataStream::operator<<(quint64 i)
|
||||
{ return *this << qint64(i); }
|
||||
|
||||
template <typename T>
|
||||
QDataStream& operator>>(QDataStream& s, QList<T>& l)
|
||||
{
|
||||
l.clear();
|
||||
quint32 c;
|
||||
s >> c;
|
||||
for(quint32 i = 0; i < c; ++i)
|
||||
{
|
||||
T t;
|
||||
s >> t;
|
||||
l.append(t);
|
||||
if (s.atEnd())
|
||||
break;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
QDataStream& operator<<(QDataStream& s, const QList<T>& l)
|
||||
{
|
||||
s << quint32(l.size());
|
||||
for (int i = 0; i < l.size(); ++i)
|
||||
s << l.at(i);
|
||||
return s;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
QDataStream& operator>>(QDataStream& s, QLinkedList<T>& l)
|
||||
{
|
||||
l.clear();
|
||||
quint32 c;
|
||||
s >> c;
|
||||
for(quint32 i = 0; i < c; ++i)
|
||||
{
|
||||
T t;
|
||||
s >> t;
|
||||
l.append(t);
|
||||
if (s.atEnd())
|
||||
break;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
QDataStream& operator<<(QDataStream& s, const QLinkedList<T>& l)
|
||||
{
|
||||
s << quint32(l.size());
|
||||
typename QLinkedList<T>::ConstIterator it = l.constBegin();
|
||||
for(; it != l.constEnd(); ++it)
|
||||
s << *it;
|
||||
return s;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
QDataStream& operator>>(QDataStream& s, QVector<T>& v)
|
||||
{
|
||||
v.clear();
|
||||
quint32 c;
|
||||
s >> c;
|
||||
v.resize(c);
|
||||
for(quint32 i = 0; i < c; ++i) {
|
||||
T t;
|
||||
s >> t;
|
||||
v[i] = t;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
QDataStream& operator<<(QDataStream& s, const QVector<T>& v)
|
||||
{
|
||||
s << quint32(v.size());
|
||||
for (typename QVector<T>::const_iterator it = v.begin(); it != v.end(); ++it)
|
||||
s << *it;
|
||||
return s;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
QDataStream &operator>>(QDataStream &in, QSet<T> &set)
|
||||
{
|
||||
set.clear();
|
||||
quint32 c;
|
||||
in >> c;
|
||||
for (quint32 i = 0; i < c; ++i) {
|
||||
T t;
|
||||
in >> t;
|
||||
set << t;
|
||||
if (in.atEnd())
|
||||
break;
|
||||
}
|
||||
return in;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
QDataStream& operator<<(QDataStream &out, const QSet<T> &set)
|
||||
{
|
||||
out << quint32(set.size());
|
||||
typename QSet<T>::const_iterator i = set.constBegin();
|
||||
while (i != set.constEnd()) {
|
||||
out << *i;
|
||||
++i;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
template <class Key, class T>
|
||||
Q_OUTOFLINE_TEMPLATE QDataStream &operator>>(QDataStream &in, QHash<Key, T> &hash)
|
||||
{
|
||||
QDataStream::Status oldStatus = in.status();
|
||||
in.resetStatus();
|
||||
hash.clear();
|
||||
|
||||
quint32 n;
|
||||
in >> n;
|
||||
|
||||
for (quint32 i = 0; i < n; ++i) {
|
||||
if (in.status() != QDataStream::Ok)
|
||||
break;
|
||||
|
||||
Key k;
|
||||
T t;
|
||||
in >> k >> t;
|
||||
hash.insertMulti(k, t);
|
||||
}
|
||||
|
||||
if (in.status() != QDataStream::Ok)
|
||||
hash.clear();
|
||||
if (oldStatus != QDataStream::Ok)
|
||||
in.setStatus(oldStatus);
|
||||
return in;
|
||||
}
|
||||
|
||||
template <class Key, class T>
|
||||
Q_OUTOFLINE_TEMPLATE QDataStream &operator<<(QDataStream &out, const QHash<Key, T>& hash)
|
||||
{
|
||||
out << quint32(hash.size());
|
||||
typename QHash<Key, T>::ConstIterator it = hash.end();
|
||||
typename QHash<Key, T>::ConstIterator begin = hash.begin();
|
||||
while (it != begin) {
|
||||
--it;
|
||||
out << it.key() << it.value();
|
||||
}
|
||||
return out;
|
||||
}
|
||||
#ifdef qdoc
|
||||
template <class Key, class T>
|
||||
Q_OUTOFLINE_TEMPLATE QDataStream &operator>>(QDataStream &in, QMap<Key, T> &map)
|
||||
#else
|
||||
template <class aKey, class aT>
|
||||
Q_OUTOFLINE_TEMPLATE QDataStream &operator>>(QDataStream &in, QMap<aKey, aT> &map)
|
||||
#endif
|
||||
{
|
||||
QDataStream::Status oldStatus = in.status();
|
||||
in.resetStatus();
|
||||
map.clear();
|
||||
|
||||
quint32 n;
|
||||
in >> n;
|
||||
|
||||
map.detach();
|
||||
map.setInsertInOrder(true);
|
||||
for (quint32 i = 0; i < n; ++i) {
|
||||
if (in.status() != QDataStream::Ok)
|
||||
break;
|
||||
|
||||
aKey key;
|
||||
aT value;
|
||||
in >> key >> value;
|
||||
map.insertMulti(key, value);
|
||||
}
|
||||
map.setInsertInOrder(false);
|
||||
if (in.status() != QDataStream::Ok)
|
||||
map.clear();
|
||||
if (oldStatus != QDataStream::Ok)
|
||||
in.setStatus(oldStatus);
|
||||
return in;
|
||||
}
|
||||
|
||||
template <class Key, class T>
|
||||
Q_OUTOFLINE_TEMPLATE QDataStream &operator<<(QDataStream &out, const QMap<Key, T> &map)
|
||||
{
|
||||
out << quint32(map.size());
|
||||
typename QMap<Key, T>::ConstIterator it = map.end();
|
||||
typename QMap<Key, T>::ConstIterator begin = map.begin();
|
||||
while (it != begin) {
|
||||
--it;
|
||||
out << it.key() << it.value();
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
#endif // QT_NO_DATASTREAM
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
QT_END_HEADER
|
||||
|
||||
#endif // QDATASTREAM_H
|
@ -0,0 +1,189 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the QtCore module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial Usage
|
||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||
** accordance with the Qt Commercial License Agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Nokia.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3.0 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU General Public License version 3.0 requirements will be
|
||||
** met: http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at qt-info@nokia.com.
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QFILEINFO_H
|
||||
#define QFILEINFO_H
|
||||
|
||||
#include <QtCore/qfile.h>
|
||||
#include <QtCore/qlist.h>
|
||||
#include <QtCore/qscopedpointer.h>
|
||||
|
||||
QT_BEGIN_HEADER
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QT_MODULE(Core)
|
||||
|
||||
class QDir;
|
||||
class QDateTime;
|
||||
class QFileInfoPrivate;
|
||||
|
||||
class Q_CORE_EXPORT QFileInfo
|
||||
{
|
||||
public:
|
||||
QFileInfo();
|
||||
QFileInfo(const QString &file);
|
||||
QFileInfo(const QFile &file);
|
||||
QFileInfo(const QDir &dir, const QString &file);
|
||||
QFileInfo(const QFileInfo &fileinfo);
|
||||
~QFileInfo();
|
||||
|
||||
QFileInfo &operator=(const QFileInfo &fileinfo);
|
||||
bool operator==(const QFileInfo &fileinfo); // 5.0 - remove me
|
||||
bool operator==(const QFileInfo &fileinfo) const;
|
||||
inline bool operator!=(const QFileInfo &fileinfo) { return !(operator==(fileinfo)); } // 5.0 - remove me
|
||||
inline bool operator!=(const QFileInfo &fileinfo) const { return !(operator==(fileinfo)); }
|
||||
|
||||
void setFile(const QString &file);
|
||||
void setFile(const QFile &file);
|
||||
void setFile(const QDir &dir, const QString &file);
|
||||
bool exists() const;
|
||||
void refresh();
|
||||
|
||||
QString filePath() const;
|
||||
QString absoluteFilePath() const;
|
||||
QString canonicalFilePath() const;
|
||||
QString fileName() const;
|
||||
QString baseName() const;
|
||||
QString completeBaseName() const;
|
||||
QString suffix() const;
|
||||
QString bundleName() const;
|
||||
QString completeSuffix() const;
|
||||
|
||||
QString path() const;
|
||||
QString absolutePath() const;
|
||||
QString canonicalPath() const;
|
||||
QDir dir() const;
|
||||
QDir absoluteDir() const;
|
||||
|
||||
bool isReadable() const;
|
||||
bool isWritable() const;
|
||||
bool isExecutable() const;
|
||||
bool isHidden() const;
|
||||
|
||||
bool isRelative() const;
|
||||
inline bool isAbsolute() const { return !isRelative(); }
|
||||
bool makeAbsolute();
|
||||
|
||||
bool isFile() const;
|
||||
bool isDir() const;
|
||||
bool isSymLink() const;
|
||||
bool isRoot() const;
|
||||
bool isBundle() const;
|
||||
|
||||
QString readLink() const;
|
||||
inline QString symLinkTarget() const { return readLink(); }
|
||||
|
||||
QString owner() const;
|
||||
uint ownerId() const;
|
||||
QString group() const;
|
||||
uint groupId() const;
|
||||
|
||||
bool permission(QFile::Permissions permissions) const;
|
||||
QFile::Permissions permissions() const;
|
||||
|
||||
qint64 size() const;
|
||||
|
||||
QDateTime created() const;
|
||||
QDateTime lastModified() const;
|
||||
QDateTime lastRead() const;
|
||||
|
||||
void detach();
|
||||
|
||||
bool caching() const;
|
||||
void setCaching(bool on);
|
||||
|
||||
#ifdef QT3_SUPPORT
|
||||
enum Permission {
|
||||
ReadOwner = QFile::ReadOwner, WriteOwner = QFile::WriteOwner, ExeOwner = QFile::ExeOwner,
|
||||
ReadUser = QFile::ReadUser, WriteUser = QFile::WriteUser, ExeUser = QFile::ExeUser,
|
||||
ReadGroup = QFile::ReadGroup, WriteGroup = QFile::WriteGroup, ExeGroup = QFile::ExeGroup,
|
||||
ReadOther = QFile::ReadOther, WriteOther = QFile::WriteOther, ExeOther = QFile::ExeOther
|
||||
};
|
||||
Q_DECLARE_FLAGS(PermissionSpec, Permission)
|
||||
|
||||
inline QT3_SUPPORT QString baseName(bool complete) {
|
||||
if(complete)
|
||||
return completeBaseName();
|
||||
return baseName();
|
||||
}
|
||||
inline QT3_SUPPORT QString extension(bool complete = true) const {
|
||||
if(complete)
|
||||
return completeSuffix();
|
||||
return suffix();
|
||||
}
|
||||
inline QT3_SUPPORT QString absFilePath() const { return absoluteFilePath(); }
|
||||
|
||||
inline QT3_SUPPORT QString dirPath(bool absPath = false) const {
|
||||
if(absPath)
|
||||
return absolutePath();
|
||||
return path();
|
||||
}
|
||||
QT3_SUPPORT QDir dir(bool absPath) const;
|
||||
inline QT3_SUPPORT bool convertToAbs() { return makeAbsolute(); }
|
||||
#if !defined(Q_NO_TYPESAFE_FLAGS)
|
||||
inline QT3_SUPPORT bool permission(PermissionSpec permissions) const
|
||||
{ return permission(QFile::Permissions(static_cast<int>(permissions))); }
|
||||
#endif
|
||||
operator QFileInfo *() const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
QScopedPointer<QFileInfoPrivate> d_ptr;
|
||||
private:
|
||||
Q_DECLARE_PRIVATE(QFileInfo)
|
||||
};
|
||||
Q_DECLARE_TYPEINFO(QFileInfo, Q_MOVABLE_TYPE);
|
||||
|
||||
#ifdef QT3_SUPPORT
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(QFileInfo::PermissionSpec)
|
||||
#endif
|
||||
|
||||
typedef QList<QFileInfo> QFileInfoList;
|
||||
#ifdef QT3_SUPPORT
|
||||
typedef QList<QFileInfo>::Iterator QFileInfoListIterator;
|
||||
#endif
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
QT_END_HEADER
|
||||
|
||||
#endif // QFILEINFO_H
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,258 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the QtCore module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial Usage
|
||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||
** accordance with the Qt Commercial License Agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Nokia.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3.0 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU General Public License version 3.0 requirements will be
|
||||
** met: http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at qt-info@nokia.com.
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QIODEVICE_H
|
||||
#define QIODEVICE_H
|
||||
|
||||
#ifndef QT_NO_QOBJECT
|
||||
#include <QtCore/qobject.h>
|
||||
#else
|
||||
#include <QtCore/qobjectdefs.h>
|
||||
#include <QtCore/qscopedpointer.h>
|
||||
#endif
|
||||
#include <QtCore/qstring.h>
|
||||
|
||||
#ifdef open
|
||||
#error qiodevice.h must be included before any header file that defines open
|
||||
#endif
|
||||
|
||||
QT_BEGIN_HEADER
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QT_MODULE(Core)
|
||||
|
||||
class QByteArray;
|
||||
class QIODevicePrivate;
|
||||
|
||||
class Q_CORE_EXPORT QIODevice
|
||||
#ifndef QT_NO_QOBJECT
|
||||
: public QObject
|
||||
#endif
|
||||
{
|
||||
#ifndef QT_NO_QOBJECT
|
||||
Q_OBJECT
|
||||
#endif
|
||||
public:
|
||||
enum OpenModeFlag {
|
||||
NotOpen = 0x0000,
|
||||
ReadOnly = 0x0001,
|
||||
WriteOnly = 0x0002,
|
||||
ReadWrite = ReadOnly | WriteOnly,
|
||||
Append = 0x0004,
|
||||
Truncate = 0x0008,
|
||||
Text = 0x0010,
|
||||
Unbuffered = 0x0020
|
||||
};
|
||||
Q_DECLARE_FLAGS(OpenMode, OpenModeFlag)
|
||||
|
||||
QIODevice();
|
||||
#ifndef QT_NO_QOBJECT
|
||||
explicit QIODevice(QObject *parent);
|
||||
#endif
|
||||
virtual ~QIODevice();
|
||||
|
||||
OpenMode openMode() const;
|
||||
|
||||
void setTextModeEnabled(bool enabled);
|
||||
bool isTextModeEnabled() const;
|
||||
|
||||
bool isOpen() const;
|
||||
bool isReadable() const;
|
||||
bool isWritable() const;
|
||||
virtual bool isSequential() const;
|
||||
|
||||
virtual bool open(OpenMode mode);
|
||||
virtual void close();
|
||||
|
||||
// ### Qt 5: pos() and seek() should not be virtual, and
|
||||
// ### seek() should call a virtual seekData() function.
|
||||
virtual qint64 pos() const;
|
||||
virtual qint64 size() const;
|
||||
virtual bool seek(qint64 pos);
|
||||
virtual bool atEnd() const;
|
||||
virtual bool reset();
|
||||
|
||||
virtual qint64 bytesAvailable() const;
|
||||
virtual qint64 bytesToWrite() const;
|
||||
|
||||
qint64 read(char *data, qint64 maxlen);
|
||||
QByteArray read(qint64 maxlen);
|
||||
QByteArray readAll();
|
||||
qint64 readLine(char *data, qint64 maxlen);
|
||||
QByteArray readLine(qint64 maxlen = 0);
|
||||
virtual bool canReadLine() const;
|
||||
|
||||
qint64 write(const char *data, qint64 len);
|
||||
qint64 write(const char *data);
|
||||
inline qint64 write(const QByteArray &data)
|
||||
{ return write(data.constData(), data.size()); }
|
||||
|
||||
qint64 peek(char *data, qint64 maxlen);
|
||||
QByteArray peek(qint64 maxlen);
|
||||
|
||||
virtual bool waitForReadyRead(int msecs);
|
||||
virtual bool waitForBytesWritten(int msecs);
|
||||
|
||||
void ungetChar(char c);
|
||||
bool putChar(char c);
|
||||
bool getChar(char *c);
|
||||
|
||||
QString errorString() const;
|
||||
|
||||
#ifndef QT_NO_QOBJECT
|
||||
Q_SIGNALS:
|
||||
void readyRead();
|
||||
void bytesWritten(qint64 bytes);
|
||||
void aboutToClose();
|
||||
void readChannelFinished();
|
||||
#endif
|
||||
|
||||
protected:
|
||||
#ifdef QT_NO_QOBJECT
|
||||
QIODevice(QIODevicePrivate &dd);
|
||||
#else
|
||||
QIODevice(QIODevicePrivate &dd, QObject *parent = 0);
|
||||
#endif
|
||||
// virtual qint64 readData(char *data, qint64 maxlen) = 0;
|
||||
virtual qint64 readLineData(char *data, qint64 maxlen);
|
||||
// virtual qint64 writeData(const char *data, qint64 len) = 0;
|
||||
|
||||
void setOpenMode(OpenMode openMode);
|
||||
|
||||
void setErrorString(const QString &errorString);
|
||||
|
||||
#ifdef QT_NO_QOBJECT
|
||||
QScopedPointer<QIODevicePrivate> d_ptr;
|
||||
#endif
|
||||
|
||||
void setState( int s );
|
||||
void setFlags( int f );
|
||||
void setStatus( int s );
|
||||
|
||||
private:
|
||||
Q_DECLARE_PRIVATE(QIODevice)
|
||||
Q_DISABLE_COPY(QIODevice)
|
||||
|
||||
#ifdef QT3_SUPPORT
|
||||
public:
|
||||
typedef qint64 Offset;
|
||||
|
||||
inline QT3_SUPPORT int flags() const { return static_cast<int>(openMode()); }
|
||||
inline QT3_SUPPORT int mode() const { return static_cast<int>(openMode()); }
|
||||
inline QT3_SUPPORT int state() const;
|
||||
|
||||
inline QT3_SUPPORT bool isDirectAccess() const { return !isSequential(); }
|
||||
inline QT3_SUPPORT bool isSequentialAccess() const { return isSequential(); }
|
||||
inline QT3_SUPPORT bool isCombinedAccess() const { return false; }
|
||||
inline QT3_SUPPORT bool isBuffered() const { return true; }
|
||||
inline QT3_SUPPORT bool isRaw() const { return false; }
|
||||
inline QT3_SUPPORT bool isSynchronous() const { return true; }
|
||||
inline QT3_SUPPORT bool isAsynchronous() const { return false; }
|
||||
inline QT3_SUPPORT bool isTranslated() const { return (openMode() & Text) != 0; }
|
||||
inline QT3_SUPPORT bool isInactive() const { return !isOpen(); }
|
||||
|
||||
typedef int Status;
|
||||
QT3_SUPPORT Status status() const;
|
||||
QT3_SUPPORT void resetStatus();
|
||||
|
||||
inline QT3_SUPPORT Offset at() const { return pos(); }
|
||||
inline QT3_SUPPORT bool at(Offset offset) { return seek(offset); }
|
||||
|
||||
inline QT3_SUPPORT qint64 readBlock(char *data, quint64 maxlen) { return read(data, maxlen); }
|
||||
inline QT3_SUPPORT qint64 writeBlock(const char *data, quint64 len) { return write(data, len); }
|
||||
inline QT3_SUPPORT qint64 writeBlock(const QByteArray &data) { return write(data); }
|
||||
|
||||
inline QT3_SUPPORT int getch() { char c; return getChar(&c) ? int(uchar(c)) : -1; }
|
||||
inline QT3_SUPPORT int putch(int c) { return putChar(char(c)) ? int(uchar(c)) : -1; }
|
||||
inline QT3_SUPPORT int ungetch(int c) { ungetChar(uchar(c)); return c; }
|
||||
#endif
|
||||
};
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(QIODevice::OpenMode)
|
||||
|
||||
#ifdef QT3_SUPPORT
|
||||
static QT3_SUPPORT_VARIABLE const uint IO_Direct = 0x0100;
|
||||
static QT3_SUPPORT_VARIABLE const uint IO_Sequential = 0x0200;
|
||||
static QT3_SUPPORT_VARIABLE const uint IO_Combined = 0x0300;
|
||||
static QT3_SUPPORT_VARIABLE const uint IO_TypeMask = 0x0300;
|
||||
|
||||
static QT3_SUPPORT_VARIABLE const uint IO_Raw = 0x0000;
|
||||
static QT3_SUPPORT_VARIABLE const uint IO_Async = 0x0000;
|
||||
|
||||
#define IO_ReadOnly QIODevice::ReadOnly
|
||||
#define IO_WriteOnly QIODevice::WriteOnly
|
||||
#define IO_ReadWrite QIODevice::ReadWrite
|
||||
#define IO_Append QIODevice::Append
|
||||
#define IO_Truncate QIODevice::Truncate
|
||||
#define IO_Translate QIODevice::Text
|
||||
#define IO_ModeMask 0x00ff
|
||||
|
||||
static QT3_SUPPORT_VARIABLE const uint IO_Open = 0x1000;
|
||||
static QT3_SUPPORT_VARIABLE const uint IO_StateMask = 0xf000;
|
||||
|
||||
static QT3_SUPPORT_VARIABLE const uint IO_Ok = 0;
|
||||
static QT3_SUPPORT_VARIABLE const uint IO_ReadError = 1;
|
||||
static QT3_SUPPORT_VARIABLE const uint IO_WriteError = 2;
|
||||
static QT3_SUPPORT_VARIABLE const uint IO_FatalError = 3;
|
||||
static QT3_SUPPORT_VARIABLE const uint IO_ResourceError = 4;
|
||||
static QT3_SUPPORT_VARIABLE const uint IO_OpenError = 5;
|
||||
static QT3_SUPPORT_VARIABLE const uint IO_ConnectError = 5;
|
||||
static QT3_SUPPORT_VARIABLE const uint IO_AbortError = 6;
|
||||
static QT3_SUPPORT_VARIABLE const uint IO_TimeOutError = 7;
|
||||
static QT3_SUPPORT_VARIABLE const uint IO_UnspecifiedError = 8;
|
||||
|
||||
inline QT3_SUPPORT int QIODevice::state() const
|
||||
{
|
||||
return isOpen() ? 0x1000 : 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(QT_NO_DEBUG_STREAM)
|
||||
class QDebug;
|
||||
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QIODevice::OpenMode modes);
|
||||
#endif
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
QT_END_HEADER
|
||||
|
||||
#endif // QIODEVICE_H
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,190 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the QtGui module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial Usage
|
||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||
** accordance with the Qt Commercial License Agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Nokia.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3.0 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU General Public License version 3.0 requirements will be
|
||||
** met: http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at qt-info@nokia.com.
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QPAINTDEVICE_H
|
||||
#define QPAINTDEVICE_H
|
||||
|
||||
#include <QtGui/qwindowdefs.h>
|
||||
#include <QtCore/qrect.h>
|
||||
|
||||
QT_BEGIN_HEADER
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QT_MODULE(Gui)
|
||||
|
||||
#if defined(Q_WS_QWS)
|
||||
class QWSDisplay;
|
||||
#endif
|
||||
|
||||
class QPaintEngine;
|
||||
|
||||
class Q_GUI_EXPORT QPaintDevice // device for QPainter
|
||||
{
|
||||
public:
|
||||
enum PaintDeviceMetric {
|
||||
PdmWidth = 1,
|
||||
PdmHeight,
|
||||
PdmWidthMM,
|
||||
PdmHeightMM,
|
||||
PdmNumColors,
|
||||
PdmDepth,
|
||||
PdmDpiX,
|
||||
PdmDpiY,
|
||||
PdmPhysicalDpiX,
|
||||
PdmPhysicalDpiY
|
||||
};
|
||||
|
||||
virtual ~QPaintDevice();
|
||||
|
||||
virtual int devType() const;
|
||||
bool paintingActive() const;
|
||||
virtual QPaintEngine *paintEngine() const = 0;
|
||||
|
||||
#if defined(Q_WS_QWS)
|
||||
static QWSDisplay *qwsDisplay();
|
||||
#endif
|
||||
|
||||
#ifdef Q_WS_WIN
|
||||
virtual HDC getDC() const;
|
||||
virtual void releaseDC(HDC hdc) const;
|
||||
#endif
|
||||
|
||||
// Windows: get device context
|
||||
// X-Windows: get drawable
|
||||
#if defined(Q_WS_WIN)
|
||||
virtual HDC handle() const;
|
||||
#elif defined(Q_WS_X11)
|
||||
virtual Qt::HANDLE handle() const;
|
||||
virtual Qt::HANDLE x11RenderHandle() const;
|
||||
#elif defined(Q_WS_MAC)
|
||||
virtual Qt::HANDLE handle() const;
|
||||
#elif defined(Q_WS_QWS)
|
||||
virtual Qt::HANDLE handle() const;
|
||||
#endif
|
||||
|
||||
int width() const { return metric(PdmWidth); }
|
||||
int height() const { return metric(PdmHeight); }
|
||||
int widthMM() const { return metric(PdmWidthMM); }
|
||||
int heightMM() const { return metric(PdmHeightMM); }
|
||||
int logicalDpiX() const { return metric(PdmDpiX); }
|
||||
int logicalDpiY() const { return metric(PdmDpiY); }
|
||||
int physicalDpiX() const { return metric(PdmPhysicalDpiX); }
|
||||
int physicalDpiY() const { return metric(PdmPhysicalDpiY); }
|
||||
#ifdef QT_DEPRECATED
|
||||
QT_DEPRECATED int numColors() const { return metric(PdmNumColors); }
|
||||
#endif
|
||||
int colorCount() const { return metric(PdmNumColors); }
|
||||
int depth() const { return metric(PdmDepth); }
|
||||
|
||||
protected:
|
||||
QPaintDevice();
|
||||
virtual int metric(PaintDeviceMetric metric) const;
|
||||
|
||||
ushort painters; // refcount
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(QPaintDevice)
|
||||
|
||||
#if defined(Q_WS_X11) && defined(QT3_SUPPORT)
|
||||
public:
|
||||
QT3_SUPPORT Display *x11Display() const;
|
||||
QT3_SUPPORT int x11Screen() const;
|
||||
QT3_SUPPORT int x11Depth() const;
|
||||
QT3_SUPPORT int x11Cells() const;
|
||||
QT3_SUPPORT Qt::HANDLE x11Colormap() const;
|
||||
QT3_SUPPORT bool x11DefaultColormap() const;
|
||||
QT3_SUPPORT void *x11Visual() const;
|
||||
QT3_SUPPORT bool x11DefaultVisual() const;
|
||||
|
||||
static QT3_SUPPORT Display *x11AppDisplay();
|
||||
static QT3_SUPPORT int x11AppScreen();
|
||||
static QT3_SUPPORT int x11AppDepth(int screen = -1);
|
||||
static QT3_SUPPORT int x11AppCells(int screen = -1);
|
||||
static QT3_SUPPORT Qt::HANDLE x11AppRootWindow(int screen = -1);
|
||||
static QT3_SUPPORT Qt::HANDLE x11AppColormap(int screen = -1);
|
||||
static QT3_SUPPORT void *x11AppVisual(int screen = -1);
|
||||
static QT3_SUPPORT bool x11AppDefaultColormap(int screen =-1);
|
||||
static QT3_SUPPORT bool x11AppDefaultVisual(int screen =-1);
|
||||
static QT3_SUPPORT int x11AppDpiX(int screen = -1);
|
||||
static QT3_SUPPORT int x11AppDpiY(int screen = -1);
|
||||
static QT3_SUPPORT void x11SetAppDpiX(int, int);
|
||||
static QT3_SUPPORT void x11SetAppDpiY(int, int);
|
||||
#endif
|
||||
|
||||
friend class QPainter;
|
||||
friend class QFontEngineMac;
|
||||
friend class QX11PaintEngine;
|
||||
friend Q_GUI_EXPORT int qt_paint_device_metric(const QPaintDevice *device, PaintDeviceMetric metric);
|
||||
};
|
||||
|
||||
#ifdef QT3_SUPPORT
|
||||
QT3_SUPPORT Q_GUI_EXPORT
|
||||
void bitBlt(QPaintDevice *dst, int dx, int dy,
|
||||
const QPaintDevice *src, int sx=0, int sy=0, int sw=-1, int sh=-1,
|
||||
bool ignoreMask=false);
|
||||
|
||||
QT3_SUPPORT Q_GUI_EXPORT
|
||||
void bitBlt(QPaintDevice *dst, int dx, int dy,
|
||||
const QImage *src, int sx=0, int sy=0, int sw=-1, int sh=-1,
|
||||
int conversion_flags=0);
|
||||
|
||||
QT3_SUPPORT Q_GUI_EXPORT
|
||||
void bitBlt(QPaintDevice *dst, const QPoint &dp,
|
||||
const QPaintDevice *src, const QRect &sr=QRect(0,0,-1,-1),
|
||||
bool ignoreMask=false);
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
Inline functions
|
||||
*****************************************************************************/
|
||||
|
||||
inline int QPaintDevice::devType() const
|
||||
{ return QInternal::UnknownDevice; }
|
||||
|
||||
inline bool QPaintDevice::paintingActive() const
|
||||
{ return painters != 0; }
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
QT_END_HEADER
|
||||
|
||||
#endif // QPAINTDEVICE_H
|
@ -0,0 +1,105 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the QtGui module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial Usage
|
||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||
** accordance with the Qt Commercial License Agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Nokia.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3.0 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU General Public License version 3.0 requirements will be
|
||||
** met: http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at qt-info@nokia.com.
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QSCROLLBAR_H
|
||||
#define QSCROLLBAR_H
|
||||
|
||||
#include <QtGui/qwidget.h>
|
||||
#include <QtGui/qabstractslider.h>
|
||||
|
||||
QT_BEGIN_HEADER
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QT_MODULE(Gui)
|
||||
|
||||
#ifndef QT_NO_SCROLLBAR
|
||||
|
||||
class QScrollBarPrivate;
|
||||
class QStyleOptionSlider;
|
||||
|
||||
class Q_GUI_EXPORT QScrollBar : public QAbstractSlider
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit QScrollBar(QWidget *parent=0);
|
||||
explicit QScrollBar(Qt::Orientation, QWidget *parent=0);
|
||||
~QScrollBar();
|
||||
|
||||
QSize sizeHint() const;
|
||||
bool event(QEvent *event);
|
||||
int sliderStart() const;
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *);
|
||||
void mousePressEvent(QMouseEvent *);
|
||||
void mouseReleaseEvent(QMouseEvent *);
|
||||
void mouseMoveEvent(QMouseEvent *);
|
||||
void hideEvent(QHideEvent*);
|
||||
void sliderChange(SliderChange change);
|
||||
#ifndef QT_NO_CONTEXTMENU
|
||||
void contextMenuEvent(QContextMenuEvent *);
|
||||
#endif
|
||||
void initStyleOption(QStyleOptionSlider *option) const;
|
||||
|
||||
#ifdef QT3_SUPPORT
|
||||
public:
|
||||
QT3_SUPPORT_CONSTRUCTOR QScrollBar(QWidget *parent, const char* name);
|
||||
QT3_SUPPORT_CONSTRUCTOR QScrollBar(Qt::Orientation, QWidget *parent, const char* name);
|
||||
QT3_SUPPORT_CONSTRUCTOR QScrollBar(int minValue, int maxValue, int lineStep, int pageStep,
|
||||
int value, Qt::Orientation, QWidget *parent=0, const char* name = 0);
|
||||
inline QT3_SUPPORT bool draggingSlider() { return isSliderDown(); }
|
||||
#endif
|
||||
|
||||
private:
|
||||
friend Q_GUI_EXPORT QStyleOptionSlider qt_qscrollbarStyleOption(QScrollBar *scrollBar);
|
||||
|
||||
Q_DISABLE_COPY(QScrollBar)
|
||||
Q_DECLARE_PRIVATE(QScrollBar)
|
||||
};
|
||||
|
||||
#endif // QT_NO_SCROLLBAR
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
QT_END_HEADER
|
||||
|
||||
#endif // QSCROLLBAR_H
|
@ -0,0 +1,134 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the QtGui module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial Usage
|
||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||
** accordance with the Qt Commercial License Agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Nokia.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3.0 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU General Public License version 3.0 requirements will be
|
||||
** met: http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at qt-info@nokia.com.
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QSLIDER_H
|
||||
#define QSLIDER_H
|
||||
|
||||
#include <QtGui/qabstractslider.h>
|
||||
|
||||
QT_BEGIN_HEADER
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QT_MODULE(Gui)
|
||||
|
||||
#ifndef QT_NO_SLIDER
|
||||
|
||||
class QSliderPrivate;
|
||||
class QStyleOptionSlider;
|
||||
class Q_GUI_EXPORT QSlider : public QAbstractSlider
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_ENUMS(TickPosition)
|
||||
Q_PROPERTY(TickPosition tickPosition READ tickPosition WRITE setTickPosition)
|
||||
Q_PROPERTY(int tickInterval READ tickInterval WRITE setTickInterval)
|
||||
|
||||
public:
|
||||
enum TickPosition {
|
||||
NoTicks = 0,
|
||||
TicksAbove = 1,
|
||||
TicksLeft = TicksAbove,
|
||||
TicksBelow = 2,
|
||||
TicksRight = TicksBelow,
|
||||
TicksBothSides = 3
|
||||
|
||||
#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN)
|
||||
,NoMarks = NoTicks,
|
||||
Above = TicksAbove,
|
||||
Left = TicksAbove,
|
||||
Below = TicksBelow,
|
||||
Right = TicksRight,
|
||||
Both = TicksBothSides
|
||||
#endif
|
||||
};
|
||||
|
||||
explicit QSlider(QWidget *parent = 0);
|
||||
explicit QSlider(Qt::Orientation orientation, QWidget *parent = 0);
|
||||
|
||||
~QSlider();
|
||||
|
||||
QSize sizeHint() const;
|
||||
QSize minimumSizeHint() const;
|
||||
|
||||
void setTickPosition(TickPosition position);
|
||||
TickPosition tickPosition() const;
|
||||
|
||||
void setTickInterval(int ti);
|
||||
int tickInterval() const;
|
||||
|
||||
bool event(QEvent *event);
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *ev);
|
||||
void mousePressEvent(QMouseEvent *ev);
|
||||
void mouseReleaseEvent(QMouseEvent *ev);
|
||||
void mouseMoveEvent(QMouseEvent *ev);
|
||||
void initStyleOption(QStyleOptionSlider *option) const;
|
||||
|
||||
#ifdef QT3_SUPPORT
|
||||
public:
|
||||
QT3_SUPPORT_CONSTRUCTOR QSlider(QWidget *parent, const char *name);
|
||||
QT3_SUPPORT_CONSTRUCTOR QSlider(Qt::Orientation, QWidget *parent, const char *name);
|
||||
QT3_SUPPORT_CONSTRUCTOR QSlider(int minValue, int maxValue, int pageStep, int value,
|
||||
Qt::Orientation orientation,
|
||||
QWidget *parent = 0, const char *name = 0);
|
||||
inline QT3_SUPPORT void setTickmarks(TickPosition position) { setTickPosition(position); }
|
||||
inline QT3_SUPPORT TickPosition tickmarks() const { return tickPosition(); }
|
||||
public Q_SLOTS:
|
||||
inline QT_MOC_COMPAT void addStep() { triggerAction(SliderSingleStepAdd); }
|
||||
inline QT_MOC_COMPAT void subtractStep() { triggerAction(SliderSingleStepSub); }
|
||||
#endif
|
||||
|
||||
private:
|
||||
friend Q_GUI_EXPORT QStyleOptionSlider qt_qsliderStyleOption(QSlider *slider);
|
||||
|
||||
Q_DISABLE_COPY(QSlider)
|
||||
Q_DECLARE_PRIVATE(QSlider)
|
||||
};
|
||||
|
||||
#endif // QT_NO_SLIDER
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
QT_END_HEADER
|
||||
|
||||
#endif // QSLIDER_H
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,975 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the QtGui module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial Usage
|
||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||
** accordance with the Qt Commercial License Agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Nokia.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3.0 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU General Public License version 3.0 requirements will be
|
||||
** met: http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at qt-info@nokia.com.
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QSTYLEOPTION_H
|
||||
#define QSTYLEOPTION_H
|
||||
|
||||
#include <QtCore/qvariant.h>
|
||||
#include <QtGui/qabstractspinbox.h>
|
||||
#include <QtGui/qicon.h>
|
||||
#include <QtGui/qmatrix.h>
|
||||
#include <QtGui/qslider.h>
|
||||
#include <QtGui/qstyle.h>
|
||||
#include <QtGui/qtabbar.h>
|
||||
#include <QtGui/qtabwidget.h>
|
||||
#include <QtGui/qrubberband.h>
|
||||
#include <QtGui/qframe.h>
|
||||
#ifndef QT_NO_ITEMVIEWS
|
||||
# include <QtCore/qabstractitemmodel.h>
|
||||
#endif
|
||||
|
||||
QT_BEGIN_HEADER
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QT_MODULE(Gui)
|
||||
|
||||
class QDebug;
|
||||
class Q3ListViewItem;
|
||||
|
||||
class Q_GUI_EXPORT QStyleOption
|
||||
{
|
||||
public:
|
||||
enum OptionType {
|
||||
SO_Default, SO_FocusRect, SO_Button, SO_Tab, SO_MenuItem,
|
||||
SO_Frame, SO_ProgressBar, SO_ToolBox, SO_Header, SO_Q3DockWindow,
|
||||
SO_DockWidget, SO_Q3ListViewItem, SO_ViewItem, SO_TabWidgetFrame,
|
||||
SO_TabBarBase, SO_RubberBand, SO_ToolBar, SO_GraphicsItem,
|
||||
|
||||
SO_Complex = 0xf0000, SO_Slider, SO_SpinBox, SO_ToolButton, SO_ComboBox,
|
||||
SO_Q3ListView, SO_TitleBar, SO_GroupBox, SO_SizeGrip,
|
||||
|
||||
SO_CustomBase = 0xf00,
|
||||
SO_ComplexCustomBase = 0xf000000
|
||||
};
|
||||
|
||||
enum StyleOptionType { Type = SO_Default };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
int version;
|
||||
int type;
|
||||
QStyle::State state;
|
||||
Qt::LayoutDirection direction;
|
||||
QRect rect;
|
||||
QFontMetrics fontMetrics;
|
||||
QPalette palette;
|
||||
|
||||
Q3ListViewItem* listViewItem() const;
|
||||
|
||||
QStyleOption(int version = QStyleOption::Version, int type = SO_Default);
|
||||
QStyleOption(const QStyleOption &other);
|
||||
~QStyleOption();
|
||||
|
||||
void init(const QWidget *w);
|
||||
inline void initFrom(const QWidget *w) { init(w); }
|
||||
QStyleOption &operator=(const QStyleOption &other);
|
||||
|
||||
bool isDefault() const;
|
||||
private:
|
||||
bool def;
|
||||
};
|
||||
|
||||
class Q_GUI_EXPORT QStyleOptionFocusRect : public QStyleOption
|
||||
{
|
||||
public:
|
||||
enum StyleOptionType { Type = SO_FocusRect };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
QColor backgroundColor;
|
||||
|
||||
QStyleOptionFocusRect();
|
||||
QStyleOptionFocusRect(const QStyleOptionFocusRect &other) : QStyleOption(Version, Type) { *this = other; }
|
||||
|
||||
protected:
|
||||
QStyleOptionFocusRect(int version);
|
||||
};
|
||||
|
||||
class Q_GUI_EXPORT QStyleOptionFrame : public QStyleOption
|
||||
{
|
||||
public:
|
||||
enum StyleOptionType { Type = SO_Frame };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
int lineWidth;
|
||||
int midLineWidth;
|
||||
|
||||
QStyleOptionFrame();
|
||||
QStyleOptionFrame(const QStyleOptionFrame &other) : QStyleOption(Version, Type) { *this = other; }
|
||||
|
||||
protected:
|
||||
QStyleOptionFrame(int version);
|
||||
};
|
||||
|
||||
class Q_GUI_EXPORT QStyleOptionFrameV2 : public QStyleOptionFrame
|
||||
{
|
||||
public:
|
||||
enum StyleOptionVersion { Version = 2 };
|
||||
enum FrameFeature {
|
||||
None = 0x00,
|
||||
Flat = 0x01
|
||||
};
|
||||
Q_DECLARE_FLAGS(FrameFeatures, FrameFeature)
|
||||
FrameFeatures features;
|
||||
|
||||
QStyleOptionFrameV2();
|
||||
QStyleOptionFrameV2(const QStyleOptionFrameV2 &other) : QStyleOptionFrame(Version) { *this = other; }
|
||||
QStyleOptionFrameV2(const QStyleOptionFrame &other);
|
||||
QStyleOptionFrameV2 &operator=(const QStyleOptionFrame &other);
|
||||
|
||||
protected:
|
||||
QStyleOptionFrameV2(int version);
|
||||
};
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(QStyleOptionFrameV2::FrameFeatures)
|
||||
|
||||
|
||||
class Q_GUI_EXPORT QStyleOptionFrameV3 : public QStyleOptionFrameV2
|
||||
{
|
||||
public:
|
||||
enum StyleOptionVersion { Version = 3 };
|
||||
QFrame::Shape frameShape : 4;
|
||||
uint unused : 28;
|
||||
|
||||
QStyleOptionFrameV3();
|
||||
QStyleOptionFrameV3(const QStyleOptionFrameV3 &other) : QStyleOptionFrameV2(Version) { *this = other; }
|
||||
QStyleOptionFrameV3(const QStyleOptionFrame &other);
|
||||
QStyleOptionFrameV3 &operator=(const QStyleOptionFrame &other);
|
||||
|
||||
protected:
|
||||
QStyleOptionFrameV3(int version);
|
||||
};
|
||||
|
||||
|
||||
#ifndef QT_NO_TABWIDGET
|
||||
class Q_GUI_EXPORT QStyleOptionTabWidgetFrame : public QStyleOption
|
||||
{
|
||||
public:
|
||||
enum StyleOptionType { Type = SO_TabWidgetFrame };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
int lineWidth;
|
||||
int midLineWidth;
|
||||
QTabBar::Shape shape;
|
||||
QSize tabBarSize;
|
||||
QSize rightCornerWidgetSize;
|
||||
QSize leftCornerWidgetSize;
|
||||
|
||||
QStyleOptionTabWidgetFrame();
|
||||
inline QStyleOptionTabWidgetFrame(const QStyleOptionTabWidgetFrame &other)
|
||||
: QStyleOption(Version, Type) { *this = other; }
|
||||
|
||||
protected:
|
||||
QStyleOptionTabWidgetFrame(int version);
|
||||
};
|
||||
|
||||
class Q_GUI_EXPORT QStyleOptionTabWidgetFrameV2 : public QStyleOptionTabWidgetFrame
|
||||
{
|
||||
public:
|
||||
enum StyleOptionVersion { Version = 2 };
|
||||
|
||||
QRect tabBarRect;
|
||||
QRect selectedTabRect;
|
||||
|
||||
QStyleOptionTabWidgetFrameV2();
|
||||
QStyleOptionTabWidgetFrameV2(const QStyleOptionTabWidgetFrameV2 &other) :
|
||||
QStyleOptionTabWidgetFrame(Version) { *this = other; }
|
||||
QStyleOptionTabWidgetFrameV2(const QStyleOptionTabWidgetFrame &other);
|
||||
QStyleOptionTabWidgetFrameV2 &operator=(const QStyleOptionTabWidgetFrame &other);
|
||||
|
||||
protected:
|
||||
QStyleOptionTabWidgetFrameV2(int version);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef QT_NO_TABBAR
|
||||
class Q_GUI_EXPORT QStyleOptionTabBarBase : public QStyleOption
|
||||
{
|
||||
public:
|
||||
enum StyleOptionType { Type = SO_TabBarBase };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
QTabBar::Shape shape;
|
||||
QRect tabBarRect;
|
||||
QRect selectedTabRect;
|
||||
|
||||
QStyleOptionTabBarBase();
|
||||
QStyleOptionTabBarBase(const QStyleOptionTabBarBase &other) : QStyleOption(Version, Type) { *this = other; }
|
||||
|
||||
protected:
|
||||
QStyleOptionTabBarBase(int version);
|
||||
};
|
||||
|
||||
class Q_GUI_EXPORT QStyleOptionTabBarBaseV2 : public QStyleOptionTabBarBase
|
||||
{
|
||||
public:
|
||||
enum StyleOptionVersion { Version = 2 };
|
||||
bool documentMode;
|
||||
QStyleOptionTabBarBaseV2();
|
||||
QStyleOptionTabBarBaseV2(const QStyleOptionTabBarBaseV2 &other) : QStyleOptionTabBarBase(Version) { *this = other; }
|
||||
QStyleOptionTabBarBaseV2(const QStyleOptionTabBarBase &other);
|
||||
QStyleOptionTabBarBaseV2 &operator=(const QStyleOptionTabBarBase &other);
|
||||
|
||||
protected:
|
||||
QStyleOptionTabBarBaseV2(int version);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
class Q_GUI_EXPORT QStyleOptionHeader : public QStyleOption
|
||||
{
|
||||
public:
|
||||
enum StyleOptionType { Type = SO_Header };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
enum SectionPosition { Beginning, Middle, End, OnlyOneSection };
|
||||
enum SelectedPosition { NotAdjacent, NextIsSelected, PreviousIsSelected,
|
||||
NextAndPreviousAreSelected };
|
||||
enum SortIndicator { None, SortUp, SortDown };
|
||||
|
||||
int section;
|
||||
QString text;
|
||||
Qt::Alignment textAlignment;
|
||||
QIcon icon;
|
||||
Qt::Alignment iconAlignment;
|
||||
SectionPosition position;
|
||||
SelectedPosition selectedPosition;
|
||||
SortIndicator sortIndicator;
|
||||
Qt::Orientation orientation;
|
||||
|
||||
QStyleOptionHeader();
|
||||
QStyleOptionHeader(const QStyleOptionHeader &other) : QStyleOption(Version, Type) { *this = other; }
|
||||
|
||||
protected:
|
||||
QStyleOptionHeader(int version);
|
||||
};
|
||||
|
||||
class Q_GUI_EXPORT QStyleOptionButton : public QStyleOption
|
||||
{
|
||||
public:
|
||||
enum StyleOptionType { Type = SO_Button };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
enum ButtonFeature { None = 0x00, Flat = 0x01, HasMenu = 0x02, DefaultButton = 0x04,
|
||||
AutoDefaultButton = 0x08, CommandLinkButton = 0x10 };
|
||||
Q_DECLARE_FLAGS(ButtonFeatures, ButtonFeature)
|
||||
|
||||
ButtonFeatures features;
|
||||
QString text;
|
||||
QIcon icon;
|
||||
QSize iconSize;
|
||||
|
||||
QStyleOptionButton();
|
||||
QStyleOptionButton(const QStyleOptionButton &other) : QStyleOption(Version, Type) { *this = other; }
|
||||
|
||||
protected:
|
||||
QStyleOptionButton(int version);
|
||||
};
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(QStyleOptionButton::ButtonFeatures)
|
||||
|
||||
#ifndef QT_NO_TABBAR
|
||||
class Q_GUI_EXPORT QStyleOptionTab : public QStyleOption
|
||||
{
|
||||
public:
|
||||
enum StyleOptionType { Type = SO_Tab };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
enum TabPosition { Beginning, Middle, End, OnlyOneTab };
|
||||
enum SelectedPosition { NotAdjacent, NextIsSelected, PreviousIsSelected };
|
||||
enum CornerWidget { NoCornerWidgets = 0x00, LeftCornerWidget = 0x01,
|
||||
RightCornerWidget = 0x02 };
|
||||
Q_DECLARE_FLAGS(CornerWidgets, CornerWidget)
|
||||
|
||||
QTabBar::Shape shape;
|
||||
QString text;
|
||||
QIcon icon;
|
||||
int row;
|
||||
TabPosition position;
|
||||
SelectedPosition selectedPosition;
|
||||
CornerWidgets cornerWidgets;
|
||||
|
||||
QStyleOptionTab();
|
||||
QStyleOptionTab(const QStyleOptionTab &other) : QStyleOption(Version, Type) { *this = other; }
|
||||
|
||||
protected:
|
||||
QStyleOptionTab(int version);
|
||||
};
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(QStyleOptionTab::CornerWidgets)
|
||||
|
||||
class Q_GUI_EXPORT QStyleOptionTabV2 : public QStyleOptionTab
|
||||
{
|
||||
public:
|
||||
enum StyleOptionVersion { Version = 2 };
|
||||
QSize iconSize;
|
||||
QStyleOptionTabV2();
|
||||
QStyleOptionTabV2(const QStyleOptionTabV2 &other) : QStyleOptionTab(Version) { *this = other; }
|
||||
QStyleOptionTabV2(const QStyleOptionTab &other);
|
||||
QStyleOptionTabV2 &operator=(const QStyleOptionTab &other);
|
||||
|
||||
protected:
|
||||
QStyleOptionTabV2(int version);
|
||||
};
|
||||
|
||||
class Q_GUI_EXPORT QStyleOptionTabV3 : public QStyleOptionTabV2
|
||||
{
|
||||
public:
|
||||
enum StyleOptionVersion { Version = 3 };
|
||||
bool documentMode;
|
||||
QSize leftButtonSize;
|
||||
QSize rightButtonSize;
|
||||
QStyleOptionTabV3();
|
||||
QStyleOptionTabV3(const QStyleOptionTabV3 &other) : QStyleOptionTabV2(Version) { *this = other; }
|
||||
QStyleOptionTabV3(const QStyleOptionTabV2 &other) : QStyleOptionTabV2(Version) { *this = other; }
|
||||
QStyleOptionTabV3(const QStyleOptionTab &other);
|
||||
QStyleOptionTabV3 &operator=(const QStyleOptionTab &other);
|
||||
|
||||
protected:
|
||||
QStyleOptionTabV3(int version);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef QT_NO_TOOLBAR
|
||||
|
||||
class Q_GUI_EXPORT QStyleOptionToolBar : public QStyleOption
|
||||
{
|
||||
public:
|
||||
enum StyleOptionType { Type = SO_ToolBar };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
enum ToolBarPosition { Beginning, Middle, End, OnlyOne };
|
||||
enum ToolBarFeature { None = 0x0, Movable = 0x1 };
|
||||
Q_DECLARE_FLAGS(ToolBarFeatures, ToolBarFeature)
|
||||
ToolBarPosition positionOfLine; // The toolbar line position
|
||||
ToolBarPosition positionWithinLine; // The position within a toolbar
|
||||
Qt::ToolBarArea toolBarArea; // The toolbar docking area
|
||||
ToolBarFeatures features;
|
||||
int lineWidth;
|
||||
int midLineWidth;
|
||||
QStyleOptionToolBar();
|
||||
QStyleOptionToolBar(const QStyleOptionToolBar &other) : QStyleOption(Version, Type) { *this = other; }
|
||||
|
||||
protected:
|
||||
QStyleOptionToolBar(int version);
|
||||
};
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(QStyleOptionToolBar::ToolBarFeatures)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
class Q_GUI_EXPORT QStyleOptionProgressBar : public QStyleOption
|
||||
{
|
||||
public:
|
||||
enum StyleOptionType { Type = SO_ProgressBar };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
int minimum;
|
||||
int maximum;
|
||||
int progress;
|
||||
QString text;
|
||||
Qt::Alignment textAlignment;
|
||||
bool textVisible;
|
||||
|
||||
QStyleOptionProgressBar();
|
||||
QStyleOptionProgressBar(const QStyleOptionProgressBar &other) : QStyleOption(Version, Type) { *this = other; }
|
||||
|
||||
protected:
|
||||
QStyleOptionProgressBar(int version);
|
||||
};
|
||||
|
||||
// Adds style info for vertical progress bars
|
||||
class Q_GUI_EXPORT QStyleOptionProgressBarV2 : public QStyleOptionProgressBar
|
||||
{
|
||||
public:
|
||||
enum StyleOptionType { Type = SO_ProgressBar };
|
||||
enum StyleOptionVersion { Version = 2 };
|
||||
Qt::Orientation orientation;
|
||||
bool invertedAppearance;
|
||||
bool bottomToTop;
|
||||
|
||||
QStyleOptionProgressBarV2();
|
||||
QStyleOptionProgressBarV2(const QStyleOptionProgressBar &other);
|
||||
QStyleOptionProgressBarV2(const QStyleOptionProgressBarV2 &other);
|
||||
QStyleOptionProgressBarV2 &operator=(const QStyleOptionProgressBar &other);
|
||||
|
||||
protected:
|
||||
QStyleOptionProgressBarV2(int version);
|
||||
};
|
||||
|
||||
class Q_GUI_EXPORT QStyleOptionMenuItem : public QStyleOption
|
||||
{
|
||||
public:
|
||||
enum StyleOptionType { Type = SO_MenuItem };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
enum MenuItemType { Normal, DefaultItem, Separator, SubMenu, Scroller, TearOff, Margin,
|
||||
EmptyArea };
|
||||
enum CheckType { NotCheckable, Exclusive, NonExclusive };
|
||||
|
||||
MenuItemType menuItemType;
|
||||
CheckType checkType;
|
||||
bool checked;
|
||||
bool menuHasCheckableItems;
|
||||
QRect menuRect;
|
||||
QString text;
|
||||
QIcon icon;
|
||||
int maxIconWidth;
|
||||
int tabWidth;
|
||||
QFont font;
|
||||
|
||||
QStyleOptionMenuItem();
|
||||
QStyleOptionMenuItem(const QStyleOptionMenuItem &other) : QStyleOption(Version, Type) { *this = other; }
|
||||
|
||||
protected:
|
||||
QStyleOptionMenuItem(int version);
|
||||
};
|
||||
|
||||
class Q_GUI_EXPORT QStyleOptionQ3ListViewItem : public QStyleOption
|
||||
{
|
||||
public:
|
||||
enum StyleOptionType { Type = SO_Q3ListViewItem };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
enum Q3ListViewItemFeature { None = 0x00, Expandable = 0x01, MultiLine = 0x02, Visible = 0x04,
|
||||
ParentControl = 0x08 };
|
||||
Q_DECLARE_FLAGS(Q3ListViewItemFeatures, Q3ListViewItemFeature)
|
||||
|
||||
Q3ListViewItemFeatures features;
|
||||
int height;
|
||||
int totalHeight;
|
||||
int itemY;
|
||||
int childCount;
|
||||
|
||||
QStyleOptionQ3ListViewItem();
|
||||
QStyleOptionQ3ListViewItem(const QStyleOptionQ3ListViewItem &other) : QStyleOption(Version, Type) { *this = other; }
|
||||
|
||||
protected:
|
||||
QStyleOptionQ3ListViewItem(int version);
|
||||
};
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(QStyleOptionQ3ListViewItem::Q3ListViewItemFeatures)
|
||||
|
||||
class Q_GUI_EXPORT QStyleOptionQ3DockWindow : public QStyleOption
|
||||
{
|
||||
public:
|
||||
enum StyleOptionType { Type = SO_Q3DockWindow };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
bool docked;
|
||||
bool closeEnabled;
|
||||
|
||||
QStyleOptionQ3DockWindow();
|
||||
QStyleOptionQ3DockWindow(const QStyleOptionQ3DockWindow &other) : QStyleOption(Version, Type) { *this = other; }
|
||||
|
||||
protected:
|
||||
QStyleOptionQ3DockWindow(int version);
|
||||
};
|
||||
|
||||
class Q_GUI_EXPORT QStyleOptionDockWidget : public QStyleOption
|
||||
{
|
||||
public:
|
||||
enum StyleOptionType { Type = SO_DockWidget };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
QString title;
|
||||
bool closable;
|
||||
bool movable;
|
||||
bool floatable;
|
||||
|
||||
QStyleOptionDockWidget();
|
||||
QStyleOptionDockWidget(const QStyleOptionDockWidget &other) : QStyleOption(Version, Type) { *this = other; }
|
||||
|
||||
protected:
|
||||
QStyleOptionDockWidget(int version);
|
||||
};
|
||||
|
||||
class Q_GUI_EXPORT QStyleOptionDockWidgetV2 : public QStyleOptionDockWidget
|
||||
{
|
||||
public:
|
||||
enum StyleOptionVersion { Version = 2 };
|
||||
|
||||
bool verticalTitleBar;
|
||||
|
||||
QStyleOptionDockWidgetV2();
|
||||
QStyleOptionDockWidgetV2(const QStyleOptionDockWidgetV2 &other)
|
||||
: QStyleOptionDockWidget(Version) { *this = other; }
|
||||
QStyleOptionDockWidgetV2(const QStyleOptionDockWidget &other);
|
||||
QStyleOptionDockWidgetV2 &operator = (const QStyleOptionDockWidget &other);
|
||||
|
||||
protected:
|
||||
QStyleOptionDockWidgetV2(int version);
|
||||
};
|
||||
|
||||
class Q_GUI_EXPORT QStyleOptionViewItem : public QStyleOption
|
||||
{
|
||||
public:
|
||||
enum StyleOptionType { Type = SO_ViewItem };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
enum Position { Left, Right, Top, Bottom };
|
||||
|
||||
Qt::Alignment displayAlignment;
|
||||
Qt::Alignment decorationAlignment;
|
||||
Qt::TextElideMode textElideMode;
|
||||
Position decorationPosition;
|
||||
QSize decorationSize;
|
||||
QFont font;
|
||||
bool showDecorationSelected;
|
||||
|
||||
QStyleOptionViewItem();
|
||||
QStyleOptionViewItem(const QStyleOptionViewItem &other) : QStyleOption(Version, Type) { *this = other; }
|
||||
|
||||
protected:
|
||||
QStyleOptionViewItem(int version);
|
||||
};
|
||||
|
||||
class Q_GUI_EXPORT QStyleOptionViewItemV2 : public QStyleOptionViewItem
|
||||
{
|
||||
public:
|
||||
enum StyleOptionVersion { Version = 2 };
|
||||
|
||||
enum ViewItemFeature {
|
||||
None = 0x00,
|
||||
WrapText = 0x01,
|
||||
Alternate = 0x02,
|
||||
HasCheckIndicator = 0x04,
|
||||
HasDisplay = 0x08,
|
||||
HasDecoration = 0x10
|
||||
};
|
||||
Q_DECLARE_FLAGS(ViewItemFeatures, ViewItemFeature)
|
||||
|
||||
ViewItemFeatures features;
|
||||
|
||||
QStyleOptionViewItemV2();
|
||||
QStyleOptionViewItemV2(const QStyleOptionViewItemV2 &other) : QStyleOptionViewItem(Version) { *this = other; }
|
||||
QStyleOptionViewItemV2(const QStyleOptionViewItem &other);
|
||||
QStyleOptionViewItemV2 &operator=(const QStyleOptionViewItem &other);
|
||||
|
||||
protected:
|
||||
QStyleOptionViewItemV2(int version);
|
||||
};
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(QStyleOptionViewItemV2::ViewItemFeatures)
|
||||
|
||||
class Q_GUI_EXPORT QStyleOptionViewItemV3 : public QStyleOptionViewItemV2
|
||||
{
|
||||
public:
|
||||
enum StyleOptionVersion { Version = 3 };
|
||||
|
||||
QLocale locale;
|
||||
const QWidget *widget;
|
||||
|
||||
QStyleOptionViewItemV3();
|
||||
QStyleOptionViewItemV3(const QStyleOptionViewItemV3 &other)
|
||||
: QStyleOptionViewItemV2(Version) { *this = other; }
|
||||
QStyleOptionViewItemV3(const QStyleOptionViewItem &other);
|
||||
QStyleOptionViewItemV3 &operator = (const QStyleOptionViewItem &other);
|
||||
|
||||
protected:
|
||||
QStyleOptionViewItemV3(int version);
|
||||
};
|
||||
|
||||
#ifndef QT_NO_ITEMVIEWS
|
||||
class Q_GUI_EXPORT QStyleOptionViewItemV4 : public QStyleOptionViewItemV3
|
||||
{
|
||||
public:
|
||||
enum StyleOptionVersion { Version = 4 };
|
||||
enum ViewItemPosition { Invalid, Beginning, Middle, End, OnlyOne };
|
||||
|
||||
QModelIndex index;
|
||||
Qt::CheckState checkState;
|
||||
QIcon icon;
|
||||
QString text;
|
||||
ViewItemPosition viewItemPosition;
|
||||
QBrush backgroundBrush;
|
||||
|
||||
QStyleOptionViewItemV4();
|
||||
QStyleOptionViewItemV4(const QStyleOptionViewItemV4 &other)
|
||||
: QStyleOptionViewItemV3(Version) { *this = other; }
|
||||
QStyleOptionViewItemV4(const QStyleOptionViewItem &other);
|
||||
QStyleOptionViewItemV4 &operator = (const QStyleOptionViewItem &other);
|
||||
|
||||
protected:
|
||||
QStyleOptionViewItemV4(int version);
|
||||
};
|
||||
#endif
|
||||
|
||||
class Q_GUI_EXPORT QStyleOptionToolBox : public QStyleOption
|
||||
{
|
||||
public:
|
||||
enum StyleOptionType { Type = SO_ToolBox };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
QString text;
|
||||
QIcon icon;
|
||||
|
||||
QStyleOptionToolBox();
|
||||
QStyleOptionToolBox(const QStyleOptionToolBox &other) : QStyleOption(Version, Type) { *this = other; }
|
||||
|
||||
protected:
|
||||
QStyleOptionToolBox(int version);
|
||||
};
|
||||
|
||||
class Q_GUI_EXPORT QStyleOptionToolBoxV2 : public QStyleOptionToolBox
|
||||
{
|
||||
public:
|
||||
enum StyleOptionVersion { Version = 2 };
|
||||
enum TabPosition { Beginning, Middle, End, OnlyOneTab };
|
||||
enum SelectedPosition { NotAdjacent, NextIsSelected, PreviousIsSelected };
|
||||
|
||||
TabPosition position;
|
||||
SelectedPosition selectedPosition;
|
||||
|
||||
QStyleOptionToolBoxV2();
|
||||
QStyleOptionToolBoxV2(const QStyleOptionToolBoxV2 &other) : QStyleOptionToolBox(Version) { *this = other; }
|
||||
QStyleOptionToolBoxV2(const QStyleOptionToolBox &other);
|
||||
QStyleOptionToolBoxV2 &operator=(const QStyleOptionToolBox &other);
|
||||
|
||||
protected:
|
||||
QStyleOptionToolBoxV2(int version);
|
||||
};
|
||||
|
||||
#ifndef QT_NO_RUBBERBAND
|
||||
class Q_GUI_EXPORT QStyleOptionRubberBand : public QStyleOption
|
||||
{
|
||||
public:
|
||||
enum StyleOptionType { Type = SO_RubberBand };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
QRubberBand::Shape shape;
|
||||
bool opaque;
|
||||
|
||||
QStyleOptionRubberBand();
|
||||
QStyleOptionRubberBand(const QStyleOptionRubberBand &other) : QStyleOption(Version, Type) { *this = other; }
|
||||
|
||||
protected:
|
||||
QStyleOptionRubberBand(int version);
|
||||
};
|
||||
#endif // QT_NO_RUBBERBAND
|
||||
|
||||
// -------------------------- Complex style options -------------------------------
|
||||
class Q_GUI_EXPORT QStyleOptionComplex : public QStyleOption
|
||||
{
|
||||
public:
|
||||
enum StyleOptionType { Type = SO_Complex };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
QStyle::SubControls subControls;
|
||||
QStyle::SubControls activeSubControls;
|
||||
|
||||
QStyleOptionComplex(int version = QStyleOptionComplex::Version, int type = SO_Complex);
|
||||
QStyleOptionComplex(const QStyleOptionComplex &other) : QStyleOption(Version, Type) { *this = other; }
|
||||
};
|
||||
|
||||
#ifndef QT_NO_SLIDER
|
||||
class Q_GUI_EXPORT QStyleOptionSlider : public QStyleOptionComplex
|
||||
{
|
||||
public:
|
||||
enum StyleOptionType { Type = SO_Slider };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
Qt::Orientation orientation;
|
||||
int minimum;
|
||||
int maximum;
|
||||
QSlider::TickPosition tickPosition;
|
||||
int tickInterval;
|
||||
bool upsideDown;
|
||||
int sliderPosition;
|
||||
int sliderValue;
|
||||
int singleStep;
|
||||
int pageStep;
|
||||
qreal notchTarget;
|
||||
bool dialWrapping;
|
||||
|
||||
QStyleOptionSlider();
|
||||
QStyleOptionSlider(const QStyleOptionSlider &other) : QStyleOptionComplex(Version, Type) { *this = other; }
|
||||
|
||||
protected:
|
||||
QStyleOptionSlider(int version);
|
||||
};
|
||||
#endif // QT_NO_SLIDER
|
||||
|
||||
#ifndef QT_NO_SPINBOX
|
||||
class Q_GUI_EXPORT QStyleOptionSpinBox : public QStyleOptionComplex
|
||||
{
|
||||
public:
|
||||
enum StyleOptionType { Type = SO_SpinBox };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
QAbstractSpinBox::ButtonSymbols buttonSymbols;
|
||||
QAbstractSpinBox::StepEnabled stepEnabled;
|
||||
bool frame;
|
||||
|
||||
QStyleOptionSpinBox();
|
||||
QStyleOptionSpinBox(const QStyleOptionSpinBox &other) : QStyleOptionComplex(Version, Type) { *this = other; }
|
||||
|
||||
protected:
|
||||
QStyleOptionSpinBox(int version);
|
||||
};
|
||||
#endif // QT_NO_SPINBOX
|
||||
|
||||
class Q_GUI_EXPORT QStyleOptionQ3ListView : public QStyleOptionComplex
|
||||
{
|
||||
public:
|
||||
enum StyleOptionType { Type = SO_Q3ListView };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
QList<QStyleOptionQ3ListViewItem> items;
|
||||
QPalette viewportPalette;
|
||||
QPalette::ColorRole viewportBGRole;
|
||||
int sortColumn;
|
||||
int itemMargin;
|
||||
int treeStepSize;
|
||||
bool rootIsDecorated;
|
||||
|
||||
QStyleOptionQ3ListView();
|
||||
QStyleOptionQ3ListView(const QStyleOptionQ3ListView &other) : QStyleOptionComplex(Version, Type) { *this = other; }
|
||||
|
||||
protected:
|
||||
QStyleOptionQ3ListView(int version);
|
||||
};
|
||||
|
||||
class Q_GUI_EXPORT QStyleOptionToolButton : public QStyleOptionComplex
|
||||
{
|
||||
public:
|
||||
enum StyleOptionType { Type = SO_ToolButton };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
enum ToolButtonFeature { None = 0x00, Arrow = 0x01, Menu = 0x04, MenuButtonPopup = Menu, PopupDelay = 0x08,
|
||||
HasMenu = 0x10 };
|
||||
Q_DECLARE_FLAGS(ToolButtonFeatures, ToolButtonFeature)
|
||||
|
||||
ToolButtonFeatures features;
|
||||
QIcon icon;
|
||||
QSize iconSize;
|
||||
QString text;
|
||||
Qt::ArrowType arrowType;
|
||||
Qt::ToolButtonStyle toolButtonStyle;
|
||||
QPoint pos;
|
||||
QFont font;
|
||||
|
||||
QStyleOptionToolButton();
|
||||
QStyleOptionToolButton(const QStyleOptionToolButton &other) : QStyleOptionComplex(Version, Type) { *this = other; }
|
||||
|
||||
protected:
|
||||
QStyleOptionToolButton(int version);
|
||||
};
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(QStyleOptionToolButton::ToolButtonFeatures)
|
||||
|
||||
class Q_GUI_EXPORT QStyleOptionComboBox : public QStyleOptionComplex
|
||||
{
|
||||
public:
|
||||
enum StyleOptionType { Type = SO_ComboBox };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
bool editable;
|
||||
QRect popupRect;
|
||||
bool frame;
|
||||
QString currentText;
|
||||
QIcon currentIcon;
|
||||
QSize iconSize;
|
||||
|
||||
QStyleOptionComboBox();
|
||||
QStyleOptionComboBox(const QStyleOptionComboBox &other) : QStyleOptionComplex(Version, Type) { *this = other; }
|
||||
|
||||
protected:
|
||||
QStyleOptionComboBox(int version);
|
||||
};
|
||||
|
||||
class Q_GUI_EXPORT QStyleOptionTitleBar : public QStyleOptionComplex
|
||||
{
|
||||
public:
|
||||
enum StyleOptionType { Type = SO_TitleBar };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
QString text;
|
||||
QIcon icon;
|
||||
int titleBarState;
|
||||
Qt::WindowFlags titleBarFlags;
|
||||
|
||||
QStyleOptionTitleBar();
|
||||
QStyleOptionTitleBar(const QStyleOptionTitleBar &other) : QStyleOptionComplex(Version, Type) { *this = other; }
|
||||
|
||||
protected:
|
||||
QStyleOptionTitleBar(int version);
|
||||
};
|
||||
|
||||
class Q_GUI_EXPORT QStyleOptionGroupBox : public QStyleOptionComplex
|
||||
{
|
||||
public:
|
||||
enum StyleOptionType { Type = SO_GroupBox };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
QStyleOptionFrameV2::FrameFeatures features;
|
||||
QString text;
|
||||
Qt::Alignment textAlignment;
|
||||
QColor textColor;
|
||||
int lineWidth;
|
||||
int midLineWidth;
|
||||
|
||||
QStyleOptionGroupBox();
|
||||
QStyleOptionGroupBox(const QStyleOptionGroupBox &other) : QStyleOptionComplex(Version, Type) { *this = other; }
|
||||
protected:
|
||||
QStyleOptionGroupBox(int version);
|
||||
};
|
||||
|
||||
class Q_GUI_EXPORT QStyleOptionSizeGrip : public QStyleOptionComplex
|
||||
{
|
||||
public:
|
||||
enum StyleOptionType { Type = SO_SizeGrip };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
Qt::Corner corner;
|
||||
|
||||
QStyleOptionSizeGrip();
|
||||
QStyleOptionSizeGrip(const QStyleOptionSizeGrip &other) : QStyleOptionComplex(Version, Type) { *this = other; }
|
||||
protected:
|
||||
QStyleOptionSizeGrip(int version);
|
||||
};
|
||||
|
||||
class Q_GUI_EXPORT QStyleOptionGraphicsItem : public QStyleOption
|
||||
{
|
||||
public:
|
||||
enum StyleOptionType { Type = SO_GraphicsItem };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
QRectF exposedRect;
|
||||
QMatrix matrix;
|
||||
qreal levelOfDetail;
|
||||
|
||||
QStyleOptionGraphicsItem();
|
||||
QStyleOptionGraphicsItem(const QStyleOptionGraphicsItem &other) : QStyleOption(Version, Type) { *this = other; }
|
||||
static qreal levelOfDetailFromTransform(const QTransform &worldTransform);
|
||||
protected:
|
||||
QStyleOptionGraphicsItem(int version);
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
T qstyleoption_cast(const QStyleOption *opt)
|
||||
{
|
||||
if (opt && opt->version >= static_cast<T>(0)->Version && (opt->type == static_cast<T>(0)->Type
|
||||
|| int(static_cast<T>(0)->Type) == QStyleOption::SO_Default
|
||||
|| (int(static_cast<T>(0)->Type) == QStyleOption::SO_Complex
|
||||
&& opt->type > QStyleOption::SO_Complex)))
|
||||
return static_cast<T>(opt);
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T qstyleoption_cast(QStyleOption *opt)
|
||||
{
|
||||
if (opt && opt->version >= static_cast<T>(0)->Version && (opt->type == static_cast<T>(0)->Type
|
||||
|| int(static_cast<T>(0)->Type) == QStyleOption::SO_Default
|
||||
|| (int(static_cast<T>(0)->Type) == QStyleOption::SO_Complex
|
||||
&& opt->type > QStyleOption::SO_Complex)))
|
||||
return static_cast<T>(opt);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// -------------------------- QStyleHintReturn -------------------------------
|
||||
class Q_GUI_EXPORT QStyleHintReturn {
|
||||
public:
|
||||
enum HintReturnType {
|
||||
SH_Default=0xf000, SH_Mask, SH_Variant
|
||||
};
|
||||
|
||||
enum StyleOptionType { Type = SH_Default };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
QStyleHintReturn(int version = QStyleOption::Version, int type = SH_Default);
|
||||
~QStyleHintReturn();
|
||||
|
||||
int version;
|
||||
int type;
|
||||
};
|
||||
|
||||
class Q_GUI_EXPORT QStyleHintReturnMask : public QStyleHintReturn {
|
||||
public:
|
||||
enum StyleOptionType { Type = SH_Mask };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
QStyleHintReturnMask();
|
||||
|
||||
QRegion region;
|
||||
};
|
||||
|
||||
class Q_GUI_EXPORT QStyleHintReturnVariant : public QStyleHintReturn {
|
||||
public:
|
||||
enum StyleOptionType { Type = SH_Variant };
|
||||
enum StyleOptionVersion { Version = 1 };
|
||||
|
||||
QStyleHintReturnVariant();
|
||||
|
||||
QVariant variant;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
T qstyleoption_cast(const QStyleHintReturn *hint)
|
||||
{
|
||||
if (hint && hint->version <= static_cast<T>(0)->Version &&
|
||||
(hint->type == static_cast<T>(0)->Type || int(static_cast<T>(0)->Type) == QStyleHintReturn::SH_Default))
|
||||
return static_cast<T>(hint);
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T qstyleoption_cast(QStyleHintReturn *hint)
|
||||
{
|
||||
if (hint && hint->version <= static_cast<T>(0)->Version &&
|
||||
(hint->type == static_cast<T>(0)->Type || int(static_cast<T>(0)->Type) == QStyleHintReturn::SH_Default))
|
||||
return static_cast<T>(hint);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QStyleOption::OptionType &optionType);
|
||||
Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QStyleOption &option);
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
QT_END_HEADER
|
||||
|
||||
#endif // QSTYLEOPTION_H
|
Loading…
Reference in new issue