2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
17 * @file FScl_CalendarbookDbMonitor.h
18 * @brief This is the header file for the _CalendarbookDbMonitor class.
20 * This header file contains the declarations of the _CalendarbookDbMonitor class.
23 #ifndef _FSCL_INTERNAL_CALENDARBOOK_DB_MONITOR_H_
24 #define _FSCL_INTERNAL_CALENDARBOOK_DB_MONITOR_H_
26 #include <unique_ptr.h>
27 #include <FBaseObject.h>
28 #include <FBaseResult.h>
29 #include <FBaseTypes.h>
31 namespace Tizen { namespace Base { namespace Runtime
36 namespace Tizen { namespace Social
38 class _ICalendarbookDbChangeEventListener;
39 class _CalendarbookDbChangeEvent;
42 * @class _CalendarbookDbMonitor
43 * @brief This class handles the _CalendarbookDbMonitor operations.
45 * @see _CalendarbookImpl
48 class _CalendarbookDbMonitor
49 : public Tizen::Base::Object
51 class _CalendarbookCallback
54 _CalendarbookCallback(void);
55 ~_CalendarbookCallback(void);
56 result Register(calendar_db_changed_cb callback, void* pUserData);
58 calendar_db_changed_cb __callback;
66 result AddListener(const _ICalendarbookDbChangeEventListener& listener);
68 result RemoveListener(const _ICalendarbookDbChangeEventListener& listener);
70 static _CalendarbookDbMonitor* GetInstance(void);
74 * This constructor is intentionally declared as private to implement the Singleton semantic.
76 _CalendarbookDbMonitor(void);
79 * This destructor is intentionally declared as private to implement the Singleton semantic.
81 virtual ~_CalendarbookDbMonitor(void);
83 result Construct(void);
86 * The implementation of this copy constructor is intentionally blank and declared as private @n
87 * to prohibit copying of objects.
89 _CalendarbookDbMonitor(const _CalendarbookDbMonitor& rhs);
91 static void OnCalendarbookDbChanged(const char* pViewUri, void* pUserData);
93 static void InitCalendarbookDbMonitor(void);
95 _CalendarbookDbMonitor& operator =(const _CalendarbookDbMonitor& rhs);
98 std::unique_ptr<_CalendarbookDbChangeEvent> __pEvent;
99 std::unique_ptr<_CalendarbookCallback> __pChangeCallback;
101 static Tizen::Base::Runtime::Mutex __mutex;
103 static _CalendarbookDbMonitor* __pCalendarbookDbMonitor;
104 friend class std::default_delete<_CalendarbookDbMonitor>;
106 }; // _CalendarbookDbMonitor
110 #endif //_FSCL_INTERNAL_CALENDARBOOK_DB_MONITOR_H_