85
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: caicondescription.cpp
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include <QDebug>
|
|
19 |
|
|
20 |
#include "caicondescription.h"
|
|
21 |
#include "caicondescription_p.h"
|
|
22 |
|
|
23 |
|
|
24 |
// ======== MEMBER FUNCTIONS ========
|
|
25 |
|
|
26 |
/*!
|
|
27 |
\class CaIconDescription
|
|
28 |
\brief This class describes entry's icon.
|
|
29 |
|
|
30 |
\example
|
|
31 |
\code
|
|
32 |
QSharedPointer<CaService> service = CaService::instance();
|
|
33 |
CaEntry entry;
|
|
34 |
entry.setText("Text");
|
|
35 |
entry.setEntryTypeName("TypeName");
|
|
36 |
CaEntry * resultEntry = service->createEntry(entry);
|
|
37 |
...
|
|
38 |
CaIconDescription iconDescription;
|
|
39 |
iconDescription.setFileName( "z:/path/iconFileName.extension" );
|
|
40 |
iconDescription.setBitmapId( 1234 );
|
|
41 |
iconDescription.setMaskId( 1235 );
|
|
42 |
iconDescription.setSkinMajorId( 987654 );
|
|
43 |
iconDescription.setSkinMinorId( 654987 );
|
|
44 |
|
|
45 |
resultEntry->setIconDescription( iconDescription );
|
|
46 |
|
|
47 |
CaIconDescription entryIconDescription;
|
|
48 |
entryIconDescription = resultEntry->iconDescription();
|
|
49 |
|
|
50 |
ASSERT( iconDescription.fileName() == entryIconDescription.fileName() );
|
|
51 |
ASSERT( iconDescription.bitmapId() == entryIconDescription.bitmapId() );
|
|
52 |
ASSERT( iconDescription.maskId() == entryIconDescription.maskId() );
|
|
53 |
ASSERT( iconDescription.skinMajorId() == entryIconDescription.skinMajorId() );
|
|
54 |
ASSERT( iconDescription.skinMinorId() == entryIconDescription.skinMinorId() );
|
|
55 |
|
|
56 |
delete resultEntry;
|
|
57 |
\endcode
|
|
58 |
|
|
59 |
*/
|
|
60 |
|
|
61 |
/*!
|
|
62 |
Default constructor.
|
|
63 |
*/
|
|
64 |
CaIconDescription::CaIconDescription() :
|
|
65 |
m_d(new CaIconDescriptionPrivate(this))
|
|
66 |
{
|
|
67 |
|
|
68 |
}
|
|
69 |
|
|
70 |
/*!
|
|
71 |
Copy constructor.
|
|
72 |
\param const reference to CaIconDescription.
|
|
73 |
*/
|
|
74 |
CaIconDescription::CaIconDescription(
|
|
75 |
const CaIconDescription &iconDescription) :
|
|
76 |
m_d(iconDescription.m_d)
|
|
77 |
{
|
|
78 |
|
|
79 |
}
|
|
80 |
|
|
81 |
/*!
|
|
82 |
Destructor.
|
|
83 |
*/
|
|
84 |
CaIconDescription::~CaIconDescription()
|
|
85 |
{
|
|
86 |
|
|
87 |
}
|
|
88 |
|
|
89 |
/*!
|
|
90 |
Copy assignment operator.
|
|
91 |
\param iconDescription const reference to CaIconDescription.
|
|
92 |
\retval reference to CaIconDescription.
|
|
93 |
*/
|
|
94 |
CaIconDescription &CaIconDescription::operator=(
|
|
95 |
const CaIconDescription &iconDescription)
|
|
96 |
{
|
|
97 |
if (m_d != iconDescription.m_d) {
|
|
98 |
m_d = iconDescription.m_d;
|
|
99 |
}
|
|
100 |
return *this;
|
|
101 |
}
|
|
102 |
|
|
103 |
/*!
|
|
104 |
Returns icon id.
|
|
105 |
\retval icon id.
|
|
106 |
*/
|
|
107 |
int CaIconDescription::id() const
|
|
108 |
{
|
|
109 |
return m_d->id();
|
|
110 |
}
|
|
111 |
|
|
112 |
/*!
|
|
113 |
Returns icon file name.
|
|
114 |
\retval file name.
|
|
115 |
*/
|
|
116 |
QString CaIconDescription::filename() const
|
|
117 |
{
|
|
118 |
return m_d->filename();
|
|
119 |
}
|
|
120 |
|
|
121 |
/*!
|
|
122 |
Sets icon file name.
|
|
123 |
\param QString with file name.
|
|
124 |
*/
|
|
125 |
void CaIconDescription::setFilename(const QString &filename)
|
|
126 |
{
|
|
127 |
m_d->setFileName(filename);
|
|
128 |
}
|
|
129 |
|
|
130 |
|
|
131 |
/*!
|
88
|
132 |
Returns skin id.
|
|
133 |
\retval skin id.
|
85
|
134 |
*/
|
88
|
135 |
QString CaIconDescription::skinId() const
|
85
|
136 |
{
|
88
|
137 |
return m_d->skinId();
|
85
|
138 |
}
|
|
139 |
|
|
140 |
/*!
|
88
|
141 |
Sets skin id
|
|
142 |
\param skin id
|
85
|
143 |
*/
|
88
|
144 |
void CaIconDescription::setSkinId(const QString &skinId)
|
85
|
145 |
{
|
88
|
146 |
m_d->setSkinId(skinId);
|
85
|
147 |
}
|
|
148 |
|
|
149 |
/*!
|
88
|
150 |
Returns icon application id.
|
|
151 |
\retval icon application id.
|
85
|
152 |
*/
|
88
|
153 |
QString CaIconDescription::applicationId() const
|
85
|
154 |
{
|
88
|
155 |
return m_d->applicationId();
|
85
|
156 |
}
|
|
157 |
|
|
158 |
/*!
|
88
|
159 |
Sets icon application id.
|
|
160 |
\param QString with icon application id.
|
85
|
161 |
*/
|
88
|
162 |
void CaIconDescription::setApplicationId(const QString &applicationId)
|
85
|
163 |
{
|
88
|
164 |
m_d->setApplicationId(applicationId);
|
85
|
165 |
}
|
|
166 |
|
|
167 |
/*!
|
|
168 |
Sets icon id
|
|
169 |
\param id
|
|
170 |
*/
|
|
171 |
void CaIconDescription::setId(int id)
|
|
172 |
{
|
|
173 |
m_d->setId(id);
|
|
174 |
}
|
|
175 |
|
|
176 |
/*!
|
|
177 |
Construcor.
|
|
178 |
\param iconDescriptionPublic pointer to CaIconDescription.
|
|
179 |
*/
|
|
180 |
CaIconDescriptionPrivate::CaIconDescriptionPrivate(
|
|
181 |
CaIconDescription *iconDescriptionPublic) :
|
88
|
182 |
m_q(iconDescriptionPublic), mId(0), mFilename(), mSkinId(),
|
|
183 |
mApplicationId(0)
|
85
|
184 |
{
|
|
185 |
}
|
|
186 |
|
|
187 |
/*!
|
|
188 |
Destructor.
|
|
189 |
*/
|
|
190 |
CaIconDescriptionPrivate::~CaIconDescriptionPrivate()
|
|
191 |
{
|
|
192 |
}
|
|
193 |
|
|
194 |
/*!
|
|
195 |
Returns icon id.
|
|
196 |
\retval icon id.
|
|
197 |
*/
|
|
198 |
int CaIconDescriptionPrivate::id() const
|
|
199 |
{
|
|
200 |
return mId;
|
|
201 |
}
|
|
202 |
|
|
203 |
/*!
|
|
204 |
Returns file name.
|
|
205 |
\retval file name.
|
|
206 |
*/
|
|
207 |
QString CaIconDescriptionPrivate::filename() const
|
|
208 |
{
|
|
209 |
return mFilename;
|
|
210 |
}
|
|
211 |
|
|
212 |
/*!
|
|
213 |
Sets a file name.
|
|
214 |
\param fileName file name
|
|
215 |
*/
|
87
|
216 |
void CaIconDescriptionPrivate::setFileName(const QString &fileName)
|
85
|
217 |
{
|
|
218 |
mFilename = fileName;
|
|
219 |
}
|
|
220 |
|
|
221 |
/*!
|
|
222 |
Returns bitmap id.
|
|
223 |
\retval bitmap id.
|
|
224 |
*/
|
88
|
225 |
QString CaIconDescriptionPrivate::skinId() const
|
85
|
226 |
{
|
88
|
227 |
return mSkinId;
|
85
|
228 |
}
|
|
229 |
|
|
230 |
/*!
|
88
|
231 |
Sets skin id.
|
|
232 |
\param skinId skin id.
|
85
|
233 |
*/
|
88
|
234 |
void CaIconDescriptionPrivate::setSkinId(const QString &skinId)
|
85
|
235 |
{
|
88
|
236 |
mSkinId = skinId;
|
85
|
237 |
}
|
|
238 |
|
|
239 |
/*!
|
88
|
240 |
Returns icon application id.
|
|
241 |
\retval icon application id.
|
85
|
242 |
*/
|
88
|
243 |
QString CaIconDescriptionPrivate::applicationId() const
|
85
|
244 |
{
|
88
|
245 |
return mApplicationId;
|
85
|
246 |
}
|
|
247 |
|
|
248 |
/*!
|
88
|
249 |
Sets icon application id.
|
|
250 |
\param applicationId icon application id.
|
85
|
251 |
*/
|
88
|
252 |
void CaIconDescriptionPrivate::setApplicationId(const QString &applicationId)
|
85
|
253 |
{
|
88
|
254 |
mApplicationId = applicationId;
|
85
|
255 |
}
|
|
256 |
|
|
257 |
|
|
258 |
/*!
|
|
259 |
Sets icon id.
|
|
260 |
\param id icon id.
|
|
261 |
*/
|
|
262 |
void CaIconDescriptionPrivate::setId(int id)
|
|
263 |
{
|
|
264 |
mId = id;
|
|
265 |
}
|
|
266 |
|