author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Mon, 04 Oct 2010 01:19:32 +0300 | |
changeset 37 | 758a864f9613 |
parent 19 | fcece45ef507 |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************************** |
2 |
** |
|
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
3 |
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 4 |
** All rights reserved. |
5 |
** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 |
** |
|
7 |
** This file is part of the QtCore module of the Qt Toolkit. |
|
8 |
** |
|
9 |
** $QT_BEGIN_LICENSE:LGPL$ |
|
10 |
** No Commercial Usage |
|
11 |
** This file contains pre-release code and may not be distributed. |
|
12 |
** You may use this file in accordance with the terms and conditions |
|
13 |
** contained in the Technology Preview License Agreement accompanying |
|
14 |
** this package. |
|
15 |
** |
|
16 |
** GNU Lesser General Public License Usage |
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 |
** General Public License version 2.1 as published by the Free Software |
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 |
** packaging of this file. Please review the following information to |
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 |
** |
|
24 |
** In addition, as a special exception, Nokia gives you certain additional |
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 |
** |
|
28 |
** If you have questions regarding the use of this file, please contact |
|
29 |
** Nokia at qt-info@nokia.com. |
|
30 |
** |
|
31 |
** |
|
32 |
** |
|
33 |
** |
|
34 |
** |
|
35 |
** |
|
36 |
** |
|
37 |
** |
|
38 |
** $QT_END_LICENSE$ |
|
39 |
** |
|
40 |
****************************************************************************/ |
|
41 |
||
42 |
#ifndef QCORE_SYMBIAN_P_H |
|
43 |
#define QCORE_SYMBIAN_P_H |
|
44 |
||
45 |
// |
|
46 |
// W A R N I N G |
|
47 |
// ------------- |
|
48 |
// |
|
49 |
// This file is not part of the Qt API. It exists for the convenience |
|
50 |
// of other Qt classes. This header file may change from version to |
|
51 |
// version without notice, or even be removed. |
|
52 |
// |
|
53 |
// We mean it. |
|
54 |
// |
|
55 |
||
56 |
#include <e32std.h> |
|
57 |
#include <QtCore/qglobal.h> |
|
58 |
#include <qstring.h> |
|
59 |
#include <qrect.h> |
|
60 |
#include <qhash.h> |
|
61 |
#include <f32file.h> |
|
62 |
||
19
fcece45ef507
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
63 |
#define QT_LSTRING2(x) L##x |
fcece45ef507
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
64 |
#define QT_LSTRING(x) QT_LSTRING2(x) |
fcece45ef507
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
65 |
|
fcece45ef507
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
66 |
#if defined(QT_LIBINFIX) |
fcece45ef507
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
67 |
# define QT_LIBINFIX_UNICODE QT_LSTRING(QT_LIBINFIX) |
fcece45ef507
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
68 |
#else |
fcece45ef507
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
69 |
# define QT_LIBINFIX_UNICODE L"" |
fcece45ef507
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
70 |
#endif |
fcece45ef507
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
71 |
|
0 | 72 |
QT_BEGIN_HEADER |
73 |
||
74 |
QT_BEGIN_NAMESPACE |
|
75 |
||
76 |
Q_CORE_EXPORT HBufC* qt_QString2HBufC(const QString& aString); |
|
77 |
||
78 |
Q_CORE_EXPORT QString qt_TDesC2QString(const TDesC& aDescriptor); |
|
79 |
inline QString qt_TDes2QString(const TDes& aDescriptor) { return qt_TDesC2QString(aDescriptor); } |
|
80 |
||
81 |
static inline QSize qt_TSize2QSize(const TSize& ts) |
|
82 |
{ |
|
83 |
return QSize(ts.iWidth, ts.iHeight); |
|
84 |
} |
|
85 |
||
86 |
static inline TSize qt_QSize2TSize(const QSize& qs) |
|
87 |
{ |
|
88 |
return TSize(qs.width(), qs.height()); |
|
89 |
} |
|
90 |
||
91 |
static inline QRect qt_TRect2QRect(const TRect& tr) |
|
92 |
{ |
|
93 |
return QRect(tr.iTl.iX, tr.iTl.iY, tr.Width(), tr.Height()); |
|
94 |
} |
|
95 |
||
96 |
static inline TRect qt_QRect2TRect(const QRect& qr) |
|
97 |
{ |
|
98 |
return TRect(TPoint(qr.left(), qr.top()), TSize(qr.width(), qr.height())); |
|
99 |
} |
|
100 |
||
101 |
// Returned TPtrC is valid as long as the given parameter is valid and unmodified |
|
102 |
static inline TPtrC qt_QString2TPtrC( const QString& string ) |
|
103 |
{ |
|
104 |
return TPtrC16(static_cast<const TUint16*>(string.utf16()), string.length()); |
|
105 |
} |
|
106 |
||
107 |
/*! |
|
108 |
\internal |
|
109 |
This class is a wrapper around the Symbian HBufC descriptor class. |
|
110 |
It makes sure that the heap allocated HBufC class is freed when it is |
|
111 |
destroyed. |
|
112 |
*/ |
|
113 |
class Q_CORE_EXPORT QHBufC |
|
114 |
{ |
|
115 |
public: |
|
116 |
QHBufC(); |
|
117 |
QHBufC(const QHBufC &src); |
|
118 |
QHBufC(HBufC *src); |
|
119 |
QHBufC(const QString &src); |
|
120 |
~QHBufC(); |
|
121 |
||
122 |
inline operator HBufC *() { return m_hBufC; } |
|
123 |
inline operator const HBufC *() const { return m_hBufC; } |
|
124 |
inline HBufC *data() { return m_hBufC; } |
|
125 |
inline const HBufC *data() const { return m_hBufC; } |
|
126 |
inline HBufC & operator*() { return *m_hBufC; } |
|
127 |
inline const HBufC & operator*() const { return *m_hBufC; } |
|
128 |
inline HBufC * operator->() { return m_hBufC; } |
|
129 |
inline const HBufC * operator->() const { return m_hBufC; } |
|
130 |
||
131 |
inline bool operator==(const QHBufC ¶m) const { return data() == param.data(); } |
|
132 |
inline bool operator!=(const QHBufC ¶m) const { return data() != param.data(); } |
|
133 |
||
134 |
private: |
|
135 |
HBufC *m_hBufC; |
|
136 |
}; |
|
137 |
||
138 |
inline uint qHash(TUid uid) |
|
139 |
{ |
|
140 |
return qHash(uid.iUid); |
|
141 |
} |
|
142 |
||
143 |
// S60 version specific function ordinals that can be resolved |
|
144 |
enum S60PluginFuncOrdinals |
|
145 |
{ |
|
146 |
S60Plugin_TimeFormatL = 1, |
|
147 |
S60Plugin_GetTimeFormatSpec = 2, |
|
148 |
S60Plugin_GetLongDateFormatSpec = 3, |
|
149 |
S60Plugin_GetShortDateFormatSpec = 4, |
|
150 |
S60Plugin_LocalizedDirectoryName = 5, |
|
151 |
S60Plugin_GetSystemDrive = 6 |
|
152 |
}; |
|
153 |
||
154 |
Q_CORE_EXPORT TLibraryFunction qt_resolveS60PluginFunc(int ordinal); |
|
155 |
||
156 |
Q_CORE_EXPORT RFs& qt_s60GetRFs(); |
|
157 |
||
158 |
// Defined in qlocale_symbian.cpp. |
|
159 |
Q_CORE_EXPORT QByteArray qt_symbianLocaleName(int code); |
|
160 |
||
161 |
QT_END_NAMESPACE |
|
162 |
||
163 |
QT_END_HEADER |
|
164 |
||
165 |
#endif //QCORE_SYMBIAN_P_H |