Init basesystem source codes.
[staging/basesystem.git] / nsframework / notification_persistent_service / server / include / ns_npp_personalization_manager.h
1 /*
2  * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
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 /// \defgroup <<Group Tag>> <<Group Name>>
19 /// \ingroup  tag_NS_NPPService
20 /// .
21 ////////////////////////////////////////////////////////////////////////////////////////////////////
22
23 ////////////////////////////////////////////////////////////////////////////////////////////////////
24 /// \ingroup  tag_NS_NPPService
25 /// \brief    This file contains declaration of singleton class CnotificationpersistentservicePersonalizationManager which is
26 ///       used to manage information of personality.
27 ///
28 ////////////////////////////////////////////////////////////////////////////////////////////////////
29
30 #ifndef NOTIFICATION_PERSISTENT_SERVICE_SERVER_INCLUDE_NS_NPP_PERSONALIZATION_MANAGER_H_
31 #define NOTIFICATION_PERSISTENT_SERVICE_SERVER_INCLUDE_NS_NPP_PERSONALIZATION_MANAGER_H_
32
33 ////////////////////////////////////////////////////////////////////////////////////////////////////
34 // Include Files
35 ////////////////////////////////////////////////////////////////////////////////////////////////////
36
37 #include <string>
38 #include <map>
39 #include "ns_npp_personality.h"
40
41 typedef std::map<std::string, CNotificationpersistentservicePersonality *> Personality_Type;
42
43 /**
44  * This class maintains information on creation of new personality or
45  * change of personality.
46  */
47 class CnotificationpersistentservicePersonalizationManager {
48  private:
49   Personality_Type *m_pmPersonality;        ///< list of personality
50
51   UI_32 m_uiUserId;               ///< unique user id
52
53   std::string m_cCurrentPersonality;          ///< current personality name
54
55   ////////////////////////////////////////////////////////////////////////////////////////////////
56   /// CreatePersonality
57   /// This function is used to create new Personality.
58   ///
59   /// \param  [IN] f_cpersonalityname
60   ///     std::string - Personality name
61   ///
62   /// \return EFrameworkunifiedStatus
63   //      EFrameworkunifiedStatus - success or failure status
64   ///
65   ////////////////////////////////////////////////////////////////////////////////////////////////
66   EFrameworkunifiedStatus CreatePersonality(const std::string &f_cpersonalityname);
67
68  public:
69   ////////////////////////////////////////////////////////////////////////////////////////////////
70   /// CnotificationpersistentservicePersonalizationManager
71   /// Constructor of CnotificationpersistentservicePersonalizationManager class
72   ///
73   /// \param
74   ///
75   /// \return
76   ///
77   ////////////////////////////////////////////////////////////////////////////////////////////////
78   CnotificationpersistentservicePersonalizationManager();
79
80   ////////////////////////////////////////////////////////////////////////////////////////////////
81   /// ~CnotificationpersistentservicePersonalizationManager
82   /// Destructor of CnotificationpersistentservicePersonalizationManager class
83   ///
84   /// \param
85   ///
86   /// \return
87   ///
88   ////////////////////////////////////////////////////////////////////////////////////////////////
89   ~CnotificationpersistentservicePersonalizationManager();
90
91   ////////////////////////////////////////////////////////////////////////////////////////////////
92   /// NotificationpersistentserviceGetPersonality
93   /// This function is used to get the current personality.
94   ///
95   /// \param  [OUT] f_cpersonalityname
96   ///     std::string - Personality name
97   ///
98   /// \return EFrameworkunifiedStatus
99   //      EFrameworkunifiedStatus - success or failure status
100   ///
101   ////////////////////////////////////////////////////////////////////////////////////////////////
102   EFrameworkunifiedStatus NotificationpersistentserviceGetPersonality(std::string &f_cpersonalityname); // NOLINT (runtime/references)
103
104   ////////////////////////////////////////////////////////////////////////////////////////////////
105   /// NotificationpersistentserviceSetPersonality
106   /// This function is used to set the new personality.
107   ///
108   /// \param  [IN] f_cpersonalityname
109   ///     std::string - Personality name
110   ///
111   /// \return EFrameworkunifiedStatus
112   //      EFrameworkunifiedStatus - success or failure status
113   ///
114   ////////////////////////////////////////////////////////////////////////////////////////////////
115   EFrameworkunifiedStatus NotificationpersistentserviceSetPersonality(const std::string f_cpersonalityname);
116
117   ////////////////////////////////////////////////////////////////////////////////////////////////
118   /// NotificationpersistentserviceIsValidPersonality
119   /// Check if user is valid or not.
120   ///
121   /// \param  [IN] f_cpersonalityname
122   ///     std::string - Personality name
123   ///
124   /// \return BOOL
125   ///     TRUE - Valid user
126   ///     FALSE - Not a valid user
127   ///
128   ////////////////////////////////////////////////////////////////////////////////////////////////
129   BOOL NotificationpersistentserviceIsValidPersonality(const std::string f_cpersonalityname);
130 };
131
132 #endif  // NOTIFICATION_PERSISTENT_SERVICE_SERVER_INCLUDE_NS_NPP_PERSONALIZATION_MANAGER_H_