sync with master
[platform/framework/native/appfw.git] / inc / FSecPrivacyInfo.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2013 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    FSecPrivacyInfo.h
20 * @brief  This is the header file for the %PrivacyInfo class.
21 *
22 * This header file contains the declarations of the %PrivacyInfo class.
23 */
24  
25 #ifndef _FSEC_PRIVACY_INFO_H_
26 #define _FSEC_PRIVACY_INFO_H_
27  
28 #include <FBaseObject.h>
29  
30 namespace Tizen { namespace Security
31 {
32  
33 /**
34 * @class        PrivacyInfo
35 * @brief        This class represents the privacy information.
36 *
37 * @since        2.1
38 *
39 * @final This class is not intended for extension.
40 *
41 * The %PrivacyInfo class represents the privacy information.
42 * %PrivacyInfo provides methods to retrieve the name and description of privilege.
43 */
44  
45 class _OSP_EXPORT_ PrivacyInfo
46         : public Tizen::Base::Object
47 {
48
49 public:
50  
51         /**
52          * The object is not fully constructed after this constructor is called. @n
53          * For full construction, the Construct() method must be called right after calling this constructor.
54          *
55          * @since               2.1
56          *
57          * @remarks             After creating an instance of this class, the Construct() method must be called explicitly to initialize this instance.
58          */
59         PrivacyInfo(void);
60  
61         /**
62          * This destructor overrides Tizen::Base::Object::~Object().
63          *
64          * @since 2.1
65          *
66          */
67         virtual ~PrivacyInfo(void);
68  
69         /**
70          * Initializes this instance of %PrivacyInfo with the specified parameters.
71          *
72          * @since               2.1
73          *
74          * @return              An error code
75          * @param[in]   privacyId                       The privacy ID
76          * @param[in]   enable                          Set to @c true to enable the privacy setting, @n
77          *                                  else @c false
78          * @exception   E_SUCCESS                       The method is successful.
79          * @exception   E_INVALID_ARG           The specified @c privacyId is invalid or the @c privacyId is not exist.
80          *
81          */
82         result Construct(const Tizen::Base::String& privacyId, bool enable = false);
83  
84         /**
85          * Gets a privacy ID.
86          *
87          * @since               2.1
88          *
89          * @return              The privacy ID.
90          *
91          */
92         Tizen::Base::String GetId(void) const;
93  
94         /**
95          * Checks whether the privacy setting is enabled.
96          *
97          * @since               2.1
98          *
99          * @return              @c true if the privacy setting is enabled, @n
100          *                              else @c false
101          * @see                 SetEnabled()
102          */
103         bool IsEnabled(void) const;
104  
105         /**
106          * Enables or disables the privacy setting.
107          *
108          * @since               2.1
109          *
110          * @param[in]   enable                  A Boolean value indicating whether the privacy setting is enabled.
111          * @see                 IsEnabled()
112          *
113          */
114         void SetEnabled(bool enable);
115  
116         /**
117          * Gets the localized display name of privacy.
118          *
119          * @since               2.1
120          *
121          * @return              The display name of privacy, else an empty string is returned if there is no value.
122          *
123          */
124         Tizen::Base::String GetDisplayName(void) const;
125  
126         /**
127          * Gets the localized description of privacy.
128          *
129          * @since               2.1
130          *
131          * @return              The description of privacy, else an empty string is returned if there is no value.
132          *
133          */
134         Tizen::Base::String GetDescription(void) const;
135  
136 private:
137  
138         //
139         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
140         //
141         // @param[in]   rhs         An instance of %PrivacyInfo
142         //
143         PrivacyInfo(const PrivacyInfo& rhs);
144  
145         //
146         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
147         //
148         // @param[in]   rhs          An instance of %PrivacyInfo
149         //
150         PrivacyInfo& operator =(const PrivacyInfo& rhs);
151  
152 private:
153  
154         class _PrivacyInfoImpl* __pImpl;
155         friend class _PrivacyInfoImpl;
156  
157 }; // PrivacyInfo
158  
159 } } // Tizen::Security
160  
161 #endif // _FSEC_PRIVACY_INFO_H_
162