author | Eckhart Koeppen <eckhart.koppen@nokia.com> |
Wed, 28 Apr 2010 13:15:16 +0300 | |
branch | RCL_3 |
changeset 15 | b25b6dc3ff8b |
parent 3 | 41300fa6a67c |
permissions | -rw-r--r-- |
0 | 1 |
/* This file is part of the KDE project |
2 |
Copyright (C) 2006-2007 Matthias Kretz <kretz@kde.org> |
|
3 |
||
4 |
This library is free software; you can redistribute it and/or |
|
5 |
modify it under the terms of the GNU Lesser General Public |
|
6 |
License as published by the Free Software Foundation; either |
|
7 |
version 2.1 of the License, or (at your option) version 3, or any |
|
8 |
later version accepted by the membership of KDE e.V. (or its |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
9 |
successor approved by the membership of KDE e.V.), Nokia Corporation |
0 | 10 |
(or its successors, if any) and the KDE Free Qt Foundation, which shall |
11 |
act as a proxy defined in Section 6 of version 3 of the license. |
|
12 |
||
13 |
This library is distributed in the hope that it will be useful, |
|
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
16 |
Lesser General Public License for more details. |
|
17 |
||
18 |
You should have received a copy of the GNU Lesser General Public |
|
19 |
License along with this library. If not, see <http://www.gnu.org/licenses/>. |
|
20 |
||
21 |
*/ |
|
22 |
||
23 |
#ifndef PHONONDEFS_H |
|
24 |
#define PHONONDEFS_H |
|
25 |
||
26 |
#include <QtCore/QtGlobal> |
|
27 |
#include "phonon_export.h" |
|
28 |
||
29 |
QT_BEGIN_HEADER |
|
30 |
QT_BEGIN_NAMESPACE |
|
31 |
||
32 |
#ifdef PHONON_BACKEND_VERSION_4_3 |
|
33 |
# ifndef PHONON_BACKEND_VERSION_4_2 |
|
34 |
# define PHONON_BACKEND_VERSION_4_2 |
|
35 |
# endif |
|
36 |
#endif |
|
37 |
||
38 |
// the following inlines are correct - exclude per line doesn't work for multiline-macros so exclude |
|
39 |
// the whole file for inline checks |
|
40 |
//krazy:excludeall=inline |
|
41 |
#define K_DECLARE_PRIVATE(Class) \ |
|
42 |
inline Class##Private* k_func() { return reinterpret_cast<Class##Private *>(k_ptr); } \ |
|
43 |
inline const Class##Private* k_func() const { return reinterpret_cast<const Class##Private *>(k_ptr); } \ |
|
44 |
friend class Class##Private; |
|
45 |
||
46 |
/** |
|
47 |
* \internal |
|
48 |
* Used in class declarations to provide the needed functions. This is used for |
|
49 |
* abstract base classes. |
|
50 |
* |
|
51 |
* \param classname The Name of the class this macro is used for. |
|
52 |
* |
|
53 |
* Example: |
|
54 |
* \code |
|
55 |
* class AbstractEffect : public QObject |
|
56 |
* { |
|
57 |
* Q _OBJECT |
|
58 |
* Q_PROPERTY(int propertyA READ propertyA WRITE setPropertyA) |
|
59 |
* PHONON_ABSTRACTBASE(AbstractEffect) |
|
60 |
* public: |
|
61 |
* int propertyA() const; |
|
62 |
* void setPropertyA(int); |
|
63 |
* }; |
|
64 |
* \endcode |
|
65 |
* |
|
66 |
* \see PHONON_OBJECT |
|
67 |
* \see PHONON_HEIR |
|
68 |
*/ |
|
69 |
#define PHONON_ABSTRACTBASE(classname) \ |
|
70 |
protected: \ |
|
71 |
/** |
|
72 |
* \internal |
|
73 |
* Constructor that is called from derived classes. |
|
74 |
* |
|
75 |
* \param parent Standard QObject parent. |
|
76 |
*/ \ |
|
77 |
classname(classname ## Private &dd, QObject *parent); \ |
|
78 |
private: |
|
79 |
||
80 |
/** |
|
81 |
* \internal |
|
82 |
* Used in class declarations to provide the needed functions. This is used for |
|
83 |
* classes that inherit QObject directly. |
|
84 |
* |
|
85 |
* \param classname The Name of the class this macro is used for. |
|
86 |
* |
|
87 |
* Example: |
|
88 |
* \code |
|
89 |
* class EffectSettings : public QObject |
|
90 |
* { |
|
91 |
* Q _OBJECT |
|
92 |
* Q_PROPERTY(int propertyA READ propertyA WRITE setPropertyA) |
|
93 |
* PHONON_OBJECT(EffectSettings) |
|
94 |
* public: |
|
95 |
* int propertyA() const; |
|
96 |
* void setPropertyA(int); |
|
97 |
* }; |
|
98 |
* \endcode |
|
99 |
* |
|
100 |
* \see PHONON_ABSTRACTBASE |
|
101 |
* \see PHONON_HEIR |
|
102 |
*/ |
|
103 |
#define PHONON_OBJECT(classname) \ |
|
104 |
public: \ |
|
105 |
/** |
|
106 |
* Constructs an object with the given \p parent. |
|
107 |
*/ \ |
|
108 |
classname(QObject *parent = 0); \ |
|
109 |
private: |
|
110 |
||
111 |
/** |
|
112 |
* \internal |
|
113 |
* Used in class declarations to provide the needed functions. This is used for |
|
114 |
* classes that inherit another Phonon object. |
|
115 |
* |
|
116 |
* \param classname The Name of the class this macro is used for. |
|
117 |
* |
|
118 |
* Example: |
|
119 |
* \code |
|
120 |
* class ConcreteEffect : public AbstractEffect |
|
121 |
* { |
|
122 |
* Q _OBJECT |
|
123 |
* Q_PROPERTY(int propertyB READ propertyB WRITE setPropertyB) |
|
124 |
* PHONON_HEIR(ConcreteEffect) |
|
125 |
* public: |
|
126 |
* int propertyB() const; |
|
127 |
* void setPropertyB(int); |
|
128 |
* }; |
|
129 |
* \endcode |
|
130 |
* |
|
131 |
* \see PHONON_ABSTRACTBASE |
|
132 |
* \see PHONON_OBJECT |
|
133 |
*/ |
|
134 |
#define PHONON_HEIR(classname) \ |
|
135 |
public: \ |
|
136 |
/** |
|
137 |
* Constructs an object with the given \p parent. |
|
138 |
*/ \ |
|
139 |
classname(QObject *parent = 0); \ |
|
140 |
||
141 |
QT_END_NAMESPACE |
|
142 |
QT_END_HEADER |
|
143 |
||
144 |
#endif // PHONONDEFS_H |