sync with tizen_2.0
[platform/framework/native/appfw.git] / inc / FBaseUtilLinkInfo.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file                FBaseUtilLinkInfo.h
20  * @brief               This is the header file for the %LinkInfo class.
21  *
22  * This header file contains the declarations of the %LinkInfo class.
23  */
24 #ifndef _FBASE_UTIL_LINK_INFO_H_
25 #define _FBASE_UTIL_LINK_INFO_H_
26
27 #include <FBaseColIList.h>
28 #include <FBaseString.h>
29 #include <FBaseUtilTypes.h>
30
31
32 namespace Tizen { namespace Base { namespace Utility
33 {
34
35 /**
36 * @class   LinkInfo
37 * @brief   This class provides methods for accessing the link, its type, and a string that represents the link.
38 *
39 * @since 2.0
40 *
41 * The %LinkInfo class provides information regarding a link. It contains methods
42 * for accessing the link, its type, and a string that represents the link.
43 */
44 class _OSP_EXPORT_ LinkInfo
45         : public Tizen::Base::Object
46 {
47 public:
48         /**
49          * This is the default constructor for this class.
50          *
51          * @since 2.0
52          *
53          * @remarks     The link and text are set to empty strings and the link type is set to @c LINK_TYPE_NONE.
54          */
55         LinkInfo(void);
56
57         /**
58          * This destructor overrides Tizen::Base::Object::~Object().
59          *
60          * @since 2.0
61          */
62         virtual ~LinkInfo(void);
63
64         /**
65          * Copying of objects using this copy constructor is allowed.
66          *
67          * @since 2.0
68          *
69          * @param[in]   value  An instance of %LinkInfo
70          */
71         LinkInfo(const LinkInfo& value);
72
73         /**
74          * Initializes an instance of %LinkInfo with the specified parameters.
75          *
76          * @since 2.0
77          *
78          * @param[in]   linkType    The link type
79          * @param[in]   link        The link
80          * @remarks     The link's @c text is set to the same string as @c link.
81          * @see         Tizen::Base::Utility::LinkType
82          */
83         LinkInfo(LinkType linkType, const Tizen::Base::String& link);
84
85         /**
86          * Initializes an instance of %LinkInfo with the specified parameters.
87          *
88          * @since 2.0
89          *
90          * @param[in]   linkType    The link type
91          * @param[in]   link        The link
92          * @param[in]   text        A string that represents the link
93          * @see         Tizen::Base::Utility::LinkType
94          */
95         LinkInfo(LinkType linkType, const Tizen::Base::String& link, const Tizen::Base::String& text);
96
97         /**
98          * Copying of objects using this copy assignment operator is allowed.
99          *
100          * @since 2.0
101          *
102          * @return      A reference to the calling instance
103          * @param[in]   rhs     An instance of %LinkInfo
104          */
105         LinkInfo& operator =(const LinkInfo& rhs);
106
107         /**
108          * Gets the link.
109          *
110          * @since 2.0
111          *
112          * @return      The string that contains the link
113          * @see         SetLink()
114          */
115         Tizen::Base::String GetLink(void) const;
116
117         /**
118          * Sets the link.
119          *
120          * @since 2.0
121          *
122          * @param[in]   link    The string that contains the link
123          * @see         GetLink()
124          */
125         void SetLink(const Tizen::Base::String& link);
126
127         /**
128          * Gets the type of the link.
129          *
130          * @since 2.0
131          *
132          * @return      The link type
133          * @see         SetLinkType()
134          * @see         Tizen::Base::Utility::LinkType
135          */
136         LinkType GetLinkType(void) const;
137
138         /**
139          * Sets the type of the link.
140          *
141          * @since 2.0
142          *
143          * @param[in]   linkType    The link type
144          * @see         GetLinkType()
145          * @see         Tizen::Base::Utility::LinkType
146          */
147         void SetLinkType(LinkType linkType);
148
149         /**
150          * Gets the string that represents the link.
151          *
152          * @since 2.0
153          *
154          * @return      The string that represents the link
155          * @see         SetText()
156          */
157         Tizen::Base::String GetText(void) const;
158
159         /**
160          * Sets the string that represents the link.
161          *
162          * @since 2.0
163          *
164          * @return      An error code
165          * @param[in]   text            The string that represents the link
166          * @see         GetText()
167          */
168         void SetText(const Tizen::Base::String& text);
169
170
171 private:
172         LinkType __linkType;
173         Tizen::Base::String __link;
174         Tizen::Base::String __text;
175
176         friend class _LinkInfoImpl;
177         class _LinkInfoImpl* __pLinkInfoImpl;
178
179 }; // LinkInfo
180
181 }}} // Tizen::Base::Utility
182
183 #endif // _FBASE_UTIL_LINK_INFO_H_