Fixed Klocwork issues
[platform/framework/native/appfw.git] / src / security / inc / FSec_PrivacyInfoImpl.h
1 //
2 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16  
17 /**
18 * @file    FSec_PrivacyInfoImpl.h
19 * @brief  This is the header file for the %_PrivacyInfoImpl class.
20 *
21 * This header file contains the declarations of the %_PrivacyInfoImpl class.
22 */
23  
24 #ifndef _FSEC_INTERNAL_PRIVACY_INFO_H_
25 #define _FSEC_INTERNAL_PRIVACY_INFO_H_
26  
27 #include <FBaseObject.h>
28  
29 namespace Tizen { namespace Security
30 {
31  
32 /**
33 * @class               _PrivacyInfoImpl
34 * @brief               This class represents the privacy information.
35 *
36 * @since 2.1
37 *
38 * @final This class is not intended for extension.
39 *
40 * The %_PrivacyInfoImpl class represents the privacy information.
41 * %_PrivacyInfoImpl provides methods to retrieve the name and description of privilege.
42 */
43  
44 class _OSP_EXPORT_ _PrivacyInfoImpl
45                          : public Tizen::Base::Object
46 {
47 public:
48  
49         /**
50          * The object is not fully constructed after this constructor is called. @n
51          * For full construction, the Construct() method must be called right after calling this constructor.
52          *
53          * @since       2.1
54          *
55          * @remarks  After creating an instance of this class, the Construct() method must be called explicitly to initialize this instance.
56          */
57         _PrivacyInfoImpl(void);
58  
59         /**
60          * This destructor overrides Tizen::Base::Object::~Object().
61          *
62          * @since 2.1
63          *
64          */
65         virtual ~_PrivacyInfoImpl(void);
66  
67         /**
68          * Initializes this instance of %_PrivacyInfoImpl with the specified parameters.
69          *
70          * @since             2.1
71          *
72          * @return           An error code
73          * @param[in]       privacyId                  The privacy ID
74          * @param[in]       enable                      Set to @c true to enable the privacy setting, @n
75          *                                                    else @c false
76          * @exception       E_SUCCESS                The method is successful.
77          * @exception      E_INVALID_ARG          The specified @c privacyId is invalid or the @c privacyId is not exist.
78          *
79          */
80         result Construct(const Tizen::Base::String& privacyId, bool enable = false);
81  
82         /**
83          * Gets a privacy ID.
84          *
85          * @since              2.1
86          *
87          * @return            The privacy ID.
88          *
89          */
90         Tizen::Base::String GetId(void) const;
91  
92         /**
93          * Checks whether the privacy setting is enabled.
94          *
95          * @since       2.1
96          *
97          * @return      @c true if the privacy setting is enabled, @n
98          *                 else @c false
99          * @see         SetEnabled()
100          */
101         bool IsEnabled(void) const;
102  
103         /**
104          * Enables or disables the privacy setting.
105          *
106          * @since       2.1
107          *
108          * @param[in]   enable                  A Boolean value indicating whether the privacy setting is enabled.
109          * @see          IsEnabled()
110          *
111          */
112         void SetEnabled(bool enable);
113  
114         /**
115          * Gets the localized display name of privacy.
116          *
117          * @since              2.1
118          *
119          * @return             The display name of privacy, else an empty string is returned if there is no value.
120          *
121          */
122         Tizen::Base::String GetDisplayName(void) const;
123  
124         /**
125          * Gets the localized description of privacy.
126          *
127          * @since              2.1
128          *
129          * @return             The description of privacy, else an empty string is returned if there is no value.
130          *
131          */
132         Tizen::Base::String GetDescription(void) const;
133  
134 private:
135  
136         //
137         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
138         //
139         // @param[in]   rhs         An instance of %_PrivacyInfoImpl
140         //
141         _PrivacyInfoImpl(const _PrivacyInfoImpl& rhs);
142  
143         //
144         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
145         //
146         // @param[in]   rhs          An instance of %_PrivacyInfoImpl
147         //
148         _PrivacyInfoImpl& operator =(const _PrivacyInfoImpl& rhs);
149
150 private:
151         Tizen::Base::String __privacyId;
152         bool __enabled;
153 }; // _PrivacyInfoImpl
154  
155 } } // Tizen::Security
156  
157 #endif // _FSEC_INTERNAL_PRIVACY_INFO_H_
158