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:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef OBJECTADAPTER_H
|
|
19 |
#define OBJECTADAPTER_H
|
|
20 |
|
|
21 |
// INCLUDES
|
|
22 |
|
|
23 |
// CLASS DECLARATION
|
|
24 |
#include <QList>
|
|
25 |
|
|
26 |
#include <cadefs.h>
|
|
27 |
|
|
28 |
#include "cainnernotifierfilter.h"
|
|
29 |
#include "canotifier.h"
|
|
30 |
#include "canotifier_p.h"
|
|
31 |
#include "cainnerquery.h"
|
|
32 |
|
|
33 |
class CaEntry;
|
|
34 |
class CaQuery;
|
|
35 |
class CaNotifierFilter;
|
|
36 |
class CCaInnerEntry;
|
|
37 |
class CCaInnerNotifierFilter;
|
86
|
38 |
class HbIcon;
|
|
39 |
class CFbsBitmap;
|
85
|
40 |
|
89
|
41 |
|
85
|
42 |
/**
|
|
43 |
* CaObjectAdapter
|
|
44 |
*
|
|
45 |
*/
|
|
46 |
class CaObjectAdapter
|
|
47 |
{
|
|
48 |
public:
|
|
49 |
|
|
50 |
//Static convertion methods between Symbian and Qt objects
|
|
51 |
|
|
52 |
/**
|
|
53 |
* Converts entry to inner entry.
|
|
54 |
* @param fromEntry entry to be converted
|
|
55 |
* @param toEntry inner entry resulting from conversion
|
|
56 |
*/
|
|
57 |
static void convertL(
|
87
|
58 |
const CaEntry &fromEntry,
|
|
59 |
CCaInnerEntry &toEntry);
|
85
|
60 |
|
|
61 |
/**
|
|
62 |
* Converts inner entry to entry.
|
|
63 |
* @param fromEntry inner entry to be converted
|
|
64 |
* @param toEntry entry resulting from conversino
|
|
65 |
*/
|
87
|
66 |
static void convert(const CCaInnerEntry &fromEntry,
|
|
67 |
CaEntry &toEntry);
|
85
|
68 |
|
|
69 |
/**
|
|
70 |
* Converts query to inner query.
|
|
71 |
* @param fromQuery query to be converted
|
|
72 |
* @param toQuery inner query resutling from conversion
|
|
73 |
*/
|
|
74 |
static void convertL(
|
87
|
75 |
const CaQuery &fromQuery,
|
|
76 |
CCaInnerQuery &toQuery);
|
85
|
77 |
|
|
78 |
/**
|
|
79 |
* Converts inner entry table to QList of pointers to entries.
|
|
80 |
* @param fromEntriesArray an array containing inner entries
|
|
81 |
* for conversion.
|
|
82 |
* @param toEntriesArray list of converted entries.
|
|
83 |
*/
|
|
84 |
static void convertL(
|
|
85 |
const RPointerArray<CCaInnerEntry>& fromEntriesArray,
|
87
|
86 |
QList<CaEntry *>& toEntriesArray);
|
85
|
87 |
|
|
88 |
/**
|
|
89 |
* Converts QList of ids to RArray of TInts.
|
|
90 |
* @param fromEntryIdList list of entry id
|
|
91 |
* @param toEntryIdArray array of entry ids
|
|
92 |
*/
|
|
93 |
static void convertL(const QList<int> &fromEntryIdList,
|
87
|
94 |
RArray<TInt>& toEntryIdArray);
|
85
|
95 |
|
|
96 |
/**
|
|
97 |
* Converts RArray of TInts to QList of ids.
|
|
98 |
* @param fromEntryIdList an array of entry ids.
|
|
99 |
* @param toEntryIdList resulgin list of entry ids.
|
|
100 |
*/
|
|
101 |
static void convertL(const RArray<TInt>& fromEntryIdList,
|
87
|
102 |
QList<int>& toEntryIdList);
|
85
|
103 |
|
|
104 |
/**
|
|
105 |
* Converts symbian error code to error code (used in QT code).
|
|
106 |
*/
|
|
107 |
static ErrorCode convertErrorCode(
|
|
108 |
TInt internalErrorCode);
|
|
109 |
|
|
110 |
/**
|
|
111 |
* Creates icon.
|
|
112 |
* @param entry entry.
|
86
|
113 |
* @return HbIcon.
|
85
|
114 |
*/
|
87
|
115 |
static HbIcon makeIcon(const CaEntry &entry, const QSize &size);
|
85
|
116 |
|
|
117 |
/**
|
|
118 |
* Converts notifier type to inner notifier type.
|
|
119 |
* @param from notifier type.
|
|
120 |
* @param to resulting inner notifier type.
|
|
121 |
*/
|
|
122 |
static void convert(
|
|
123 |
CaNotifierPrivate::NotifierType from,
|
87
|
124 |
CCaInnerNotifierFilter::TNotifierType &to);
|
85
|
125 |
|
|
126 |
/**
|
|
127 |
* Converts inner change type to change type.
|
|
128 |
* @param from inner change type.
|
|
129 |
* @param to resulting change type.
|
|
130 |
*/
|
|
131 |
static void convert(
|
87
|
132 |
TChangeType src, ChangeType &dest);
|
85
|
133 |
|
|
134 |
/**
|
|
135 |
* Converts filter to inner filter.
|
|
136 |
* @param from notifier filter.
|
|
137 |
* @param to resulting notifier filter.
|
|
138 |
*/
|
|
139 |
static void convertL(
|
|
140 |
const CaNotifierFilter &from,
|
|
141 |
CCaInnerNotifierFilter &to);
|
|
142 |
|
|
143 |
/**
|
|
144 |
* Set entry id.
|
|
145 |
* @param entry entry.
|
|
146 |
* @param id entry id.
|
|
147 |
*/
|
|
148 |
static void setId(CaEntry &entry,
|
87
|
149 |
int id);
|
85
|
150 |
|
|
151 |
private:
|
|
152 |
/**
|
|
153 |
* Creates icon. Leaving version.
|
|
154 |
* @param entry entry.
|
86
|
155 |
* @return HbIcon.
|
85
|
156 |
*/
|
87
|
157 |
static HbIcon makeIconL(const CaEntry &entry, const QSize &size);
|
85
|
158 |
|
|
159 |
/**
|
|
160 |
* Make bitmap copy, used to get rid of compression for extended bitmap
|
|
161 |
* @param input input bitmap.
|
|
162 |
* @return copied bitmap.
|
|
163 |
*/
|
87
|
164 |
static CFbsBitmap *copyBitmapLC(CFbsBitmap *input);
|
85
|
165 |
|
|
166 |
/**
|
|
167 |
* Maps a given sort subject and the order to be applied
|
|
168 |
* into a sort code used
|
|
169 |
* @param sortAttribute - what is to be sorted
|
|
170 |
* @param sortOrder - how it is to be sorted
|
|
171 |
* @return sort code corresponding to input parameters
|
|
172 |
*/
|
|
173 |
static CCaInnerQuery::TSortAttribute getSortCode(
|
|
174 |
SortAttribute sortAttribute,
|
|
175 |
Qt::SortOrder sortOrder);
|
|
176 |
|
|
177 |
};
|
|
178 |
|
|
179 |
#endif // OBJECTADAPTER_H
|