2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.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
8 // http://floralicense.org/license/
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.
18 * @file CallSettingDataService.h
19 * @brief This is the header file for the %CallSettingDataService class.
21 * This header file contains the declarations for %CallSettingDataService class.
23 #ifndef _PHN_CALL_SETTING_DATA_SERVICE_H_
24 #define _PHN_CALL_SETTING_DATA_SERVICE_H_
29 #include "CallRejectInfo.h"
30 #include "CallSpeedDialInfo.h"
33 * @class CallSettingDataService
34 * @brief This class providing database service APIS to CallRejectInfo Application forms
37 class CallSettingDataService
41 * Creates an instance of its own.
42 * creates CallSettingDataService(singleton) if it does not exist else returns the existing form
44 static CallSettingDataService* CreateInstance(void);
46 virtual ~CallSettingDataService(void);
48 ///Opens the Database.
50 * Only one Database is maintained. Its name is hardcoded.
51 * It is assumed that OpenDB is called once while starting the application and CloseDB is called once while closing application.
53 result OpenDatabase(void);
55 ///Closes the Database
56 result CloseDatabase(void);
58 ///Creates a database table to store CallRejectInfo information
59 result CreateCallRejectTableDatabase(void);
60 ///Creates a database table to store SpeedDial information
61 result CreateSpeedDialTableDatabase(void);
62 ///Searches for a keyword in the CallRejectInfo Contents from Database
64 * @param search keyword
65 * @param Linked list to store the result of the search
67 bool IsCallToBeRejected(Tizen::Base::String& phoneNumber);
72 * made private as CallSettingDataService a singleton.
74 CallSettingDataService(void);
78 * made private as CallSettingDataService a singleton.
80 CallSettingDataService(const CallSettingDataService& dataService);
84 * made private as CallSettingDataService a singleton.
86 CallSettingDataService& operator =(const CallSettingDataService& dataService);
88 //checks if the condition is applicable for the passed phoneNumber
89 bool CheckRejectCondition(Tizen::Base::String& phoneNumber, CallRejectInfo& callRejectInfo);
91 ///singleton CallSettingDataService object
92 static CallSettingDataService* __pCallSettingDataService;
96 * Its made static as we need only one instance of it across different CallSettingDataService object calls.
97 * Its created while calling OpenDB and distructed while calling CloseDB.
99 static Tizen::Io::Database* __pDatabase;
101 ///name of the database
102 const Tizen::Base::String __strDbName;
104 /// an Enumerator used to iterate through the results of a database query.
105 Tizen::Io::DbEnumerator* __pEnum;
107 /// Used to create and execute database statements(queries)
108 Tizen::Io::DbStatement* __pStmt;
111 #endif /* _PHN_CALL_SETTING_DATA_SERVICE_H_ */