82183b1d2e3bb4a8381d67a760e9fefaefa97eb2
[framework/osp/social.git] / inc / FSclRelationship.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 * @file         FSclRelationship.h
19 * @brief        This is the header file for the %Relationship class.
20 *
21 * This header file contains the declarations of the %Relationship class.
22 */
23 #ifndef _FSCL_RELATIONSHIP_H_
24 #define _FSCL_RELATIONSHIP_H_
25
26 #include <FBaseResult.h>
27 #include <FBaseObject.h>
28 #include <FBaseString.h>
29 #include <FSclTypes.h>
30
31 namespace Tizen { namespace Social
32 {
33
34 /**
35 * @class        Relationship
36 * @brief        This class represents a relation.
37 *
38 * @since        2.0
39 *
40 * @final        This class is not intended for extension.
41 *
42 * The %Relationship class represents a relation. A relation consists of the type, label, and name. 
43 *
44 */
45 class _OSP_EXPORT_ Relationship
46         : public Tizen::Base::Object
47 {
48 public:
49         /**
50          * This is the default constructor for this class.
51          *
52          * @since       2.0
53          */
54         Relationship(void);
55
56         /**
57          * Copying of objects using this copy constructor is allowed.
58          *
59          * @since       2.0
60          *
61          * @param[in]   rhs     An instance of %Relationship
62          */
63         Relationship(const Relationship& rhs);
64
65         /**
66          * This destructor overrides Tizen::Base::Object::~Object().
67          *
68          * @since       2.0
69          */
70         virtual ~Relationship(void);
71
72         /**
73          * Checks whether the value of the specified instance is equal to the value of the current instance of Tizen::Base::Object.
74          *
75          * @since       2.0
76          *
77          * @return      @c true if the value of the specified instance of Tizen::Base::Object is equal to the value of the current instance of %Tizen::Base::Object, @n
78          *                      else @c false
79          * @param[in]   rhs             An instance of Tizen::Base::Object to compare
80          */
81         virtual bool Equals(const Tizen::Base::Object& rhs) const;
82
83         /**
84          * Gets the hash value of the current instance of Tizen::Base::Object.
85          *
86          * @since       2.0
87          *
88          * @return      An integer value indicating the hash value of the current instance of Tizen::Base::Object
89          */
90         virtual int GetHashCode(void) const;
91
92         /**
93          * Gets the relation type.
94          *
95          * @since       2.0
96          *
97          * @return      The type of the relation
98          */
99         RelationshipType GetType(void) const;
100
101         /**
102          * Gets the name of the relative.
103          *
104          * @since       2.0
105          *
106          * @return      The name of the relative
107          */
108         Tizen::Base::String GetRelativeName(void) const;
109
110         /**
111          * Gets the label of the relation.
112          *
113          * @since       2.0
114          *
115          * @return      The relation label
116          * @see SetLabel()
117          */
118         Tizen::Base::String GetLabel(void) const;
119
120         /**
121          * Sets the relation type.
122          *
123          * @since       2.0
124          *
125          * @param[in]   type            The type of the relation
126          */
127         void SetType(RelationshipType type);
128
129         /**
130          * Sets the label of a relation.
131          *
132          * @since       2.0
133          *
134          * @param[in]   label           The relation label
135          * @see GetLabel()
136          */
137         void SetLabel(const Tizen::Base::String& label);
138
139         /**
140          * Sets the name of the relative.
141          *
142          * @since       2.0
143          *
144          * @param[in]   relativeName            The name of the relative
145          */
146         void SetRelativeName(const Tizen::Base::String& relativeName);
147
148         /**
149          * Copying of objects using this copy assignment operator is allowed.
150          *
151          * @since       2.0
152          *
153          * @param[in]   rhs     An instance of %Relationship
154          */
155         Relationship& operator =(const Relationship& rhs);
156
157         /**
158          * Checks whether the data in the specified instance of %Relationship is equal to the data in the current instance.
159          *
160          * @since       2.0
161          *
162          * @return              @c true if the data in the specified instance equals the data in the current instance, @n
163          *                              else @c false
164          * @param[in]   rhs             An instance of %Relationship
165          */
166         bool operator ==(const Relationship& rhs) const;
167
168         /**
169          * Checks whether the data in the specified instance of %Relationship is not equal to the data in the current instance.
170          *
171          * @since       2.0
172          *
173          * @return              @c true if the data in the specified instance is not equal to the data in the current instance, @n
174          *                              else @c false
175          * @param[in]   rhs             An instance of %Relationship
176          */
177         bool operator !=(const Relationship& rhs) const;
178
179 private:
180         RelationshipType __type;
181         Tizen::Base::String __label;
182         Tizen::Base::String __name;
183
184         friend class _RelationshipImpl;
185         class _RelationshipImpl* __pRelationshipImpl;
186 }; // Relationship
187
188 }} // Tizen::Social
189
190 #endif // _FSCL_RELATIONSHIP_H_