18
|
1 |
/**
|
|
2 |
* Copyright (c) 2010 Sasken Communication Technologies Ltd.
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of the "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 |
* Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
* Manasij Roy, Nalina Hariharan
|
|
14 |
*
|
|
15 |
* Description:
|
|
16 |
* The SmfUrl class represents an URL. This class has been constructed based on
|
|
17 |
* the link element of the The Atom Syndication Format
|
|
18 |
* (refer http://tools.ietf.org/html/rfc4287).
|
|
19 |
* For detailed description about atom link relations, refer
|
|
20 |
* "http://www.iana.org/assignments/link-relations/link-relations.xhtml"
|
|
21 |
*
|
|
22 |
*/
|
|
23 |
|
|
24 |
#ifndef SMFURL_H_
|
|
25 |
#define SMFURL_H_
|
|
26 |
|
|
27 |
#include <qdatastream.h>
|
|
28 |
#include <QSharedData>
|
|
29 |
#include <smfclientglobal.h>
|
|
30 |
#include <QMetaType>
|
|
31 |
|
|
32 |
class SmfUrlPrivate;
|
|
33 |
|
|
34 |
/**
|
|
35 |
* @ingroup smf_common_group
|
|
36 |
* The SmfUrl class represents an URL. This class has been constructed based on
|
|
37 |
* the link element of the The Atom Syndication Format
|
|
38 |
* (refer http://tools.ietf.org/html/rfc4287)
|
|
39 |
* For detailed description about atom link relations, refer
|
|
40 |
* "http://www.iana.org/assignments/link-relations/link-relations.xhtml"
|
|
41 |
*/
|
|
42 |
class SMFCOMMON_EXPORT SmfUrl
|
|
43 |
{
|
|
44 |
public:
|
|
45 |
/**
|
|
46 |
* Constructor with default argument
|
|
47 |
*/
|
|
48 |
SmfUrl( );
|
|
49 |
|
|
50 |
/**
|
|
51 |
* Copy Constructor
|
|
52 |
* @param aOther The reference object
|
|
53 |
*/
|
|
54 |
SmfUrl( const SmfUrl &aOther );
|
|
55 |
|
|
56 |
/**
|
|
57 |
* Overloaded = operator
|
|
58 |
* @param aOther The reference object
|
|
59 |
*/
|
|
60 |
SmfUrl& operator=( const SmfUrl &aOther );
|
|
61 |
|
|
62 |
/**
|
|
63 |
* Destructor
|
|
64 |
*/
|
|
65 |
~SmfUrl( );
|
|
66 |
|
|
67 |
/**
|
|
68 |
* Method to get the href attribute of the link
|
|
69 |
* @return The href attribute of the link
|
|
70 |
*/
|
|
71 |
QUrl href( ) const;
|
|
72 |
|
|
73 |
/**
|
|
74 |
* Method to get the rel attribute of the link
|
|
75 |
* @return The rel attribute of the link
|
|
76 |
*/
|
|
77 |
QString rel( ) const;
|
|
78 |
|
|
79 |
/**
|
|
80 |
* Method to get the type attribute of the link
|
|
81 |
* @return The type attribute of the link
|
|
82 |
*/
|
|
83 |
QString type( ) const;
|
|
84 |
|
|
85 |
/**
|
|
86 |
* Method to get the hreflang attribute of the link
|
|
87 |
* @return The hreflang attribute of the link
|
|
88 |
*/
|
|
89 |
QString hreflang( ) const;
|
|
90 |
|
|
91 |
/**
|
|
92 |
* Method to get the title attribute of the link
|
|
93 |
* @return The title attribute of the link
|
|
94 |
*/
|
|
95 |
QString title( ) const;
|
|
96 |
|
|
97 |
/**
|
|
98 |
* Method to get the length attribute of the link
|
|
99 |
* @return The length attribute of the link
|
|
100 |
*/
|
|
101 |
QString length( ) const;
|
|
102 |
|
|
103 |
/**
|
|
104 |
* Method to get the id of the URL
|
|
105 |
* @return The ID of the URL
|
|
106 |
*/
|
|
107 |
QString id( ) const;
|
|
108 |
|
|
109 |
/**
|
|
110 |
* Method to set the href attribute of the link
|
|
111 |
* @param aData The href attribute of the link
|
|
112 |
*/
|
|
113 |
void setHref( const QUrl& aData );
|
|
114 |
|
|
115 |
/**
|
|
116 |
* Method to set the rel attribute of the link
|
|
117 |
* @param aData The rel attribute of the link
|
|
118 |
*/
|
|
119 |
void setRel( const QString &aData );
|
|
120 |
|
|
121 |
/**
|
|
122 |
* Method to set the type attribute of the link
|
|
123 |
* @param aData The type attribute of the link
|
|
124 |
*/
|
|
125 |
void setType( const QString &aData );
|
|
126 |
|
|
127 |
/**
|
|
128 |
* Method to set the hreflang attribute of the link
|
|
129 |
* @param aData The hreflang attribute of the link
|
|
130 |
*/
|
|
131 |
void setHhreflang( const QString &aData );
|
|
132 |
|
|
133 |
/**
|
|
134 |
* Method to set the title attribute of the link
|
|
135 |
* @param aData The title attribute of the link
|
|
136 |
*/
|
|
137 |
void setTitle( const QString &aData );
|
|
138 |
|
|
139 |
/**
|
|
140 |
* Method to set the length attribute of the link
|
|
141 |
* @param aData The length attribute of the link
|
|
142 |
*/
|
|
143 |
void setLength( const QString &aData );
|
|
144 |
|
|
145 |
/**
|
|
146 |
* Method to set the id of the URL
|
|
147 |
* @param aId The ID of the URL
|
|
148 |
*/
|
|
149 |
void setId( const QString &aId );
|
|
150 |
|
|
151 |
private:
|
|
152 |
QSharedDataPointer<SmfUrlPrivate> d;
|
|
153 |
|
|
154 |
friend QDataStream &operator<<( QDataStream &aDataStream,
|
|
155 |
const SmfUrl &aUrl );
|
|
156 |
|
|
157 |
friend QDataStream &operator>>( QDataStream &aDataStream,
|
|
158 |
SmfUrl &aUrl );
|
|
159 |
|
|
160 |
};
|
|
161 |
|
|
162 |
|
|
163 |
/**
|
|
164 |
* Method for Externalization. Writes the SmfUrl object to
|
|
165 |
* the stream and returns a reference to the stream.
|
|
166 |
* @param aDataStream Stream to be written
|
|
167 |
* @param aUrl The SmfUrl object to be externalized
|
|
168 |
* @return reference to the written stream
|
|
169 |
*/
|
|
170 |
SMFCOMMON_EXPORT QDataStream &operator<<( QDataStream &aDataStream,
|
|
171 |
const SmfUrl &aUrl );
|
|
172 |
|
|
173 |
/**
|
|
174 |
* Method for Internalization. Reads a SmfUrl object from
|
|
175 |
* the stream and returns a reference to the stream.
|
|
176 |
* @param aDataStream Stream to be read
|
|
177 |
* @param aUrl The SmfUrl object to be internalized
|
|
178 |
* @return reference to the stream
|
|
179 |
*/
|
|
180 |
SMFCOMMON_EXPORT QDataStream &operator>>( QDataStream &aDataStream,
|
|
181 |
SmfUrl &aUrl);
|
|
182 |
|
|
183 |
typedef QList<SmfUrl> SmfUrlList;
|
|
184 |
|
|
185 |
// Make the class SmfUrl known to QMetaType, so that as to register it.
|
|
186 |
Q_DECLARE_METATYPE(SmfUrl)
|
|
187 |
Q_DECLARE_METATYPE(QList<SmfUrl>)
|
|
188 |
|
|
189 |
#endif /* SMFURL_H_ */
|
|
190 |
|