2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file FScl_CalendarbookDbMonitor.h
19 * @brief This is the header file for the _CalendarbookDbMonitor class.
21 * This header file contains the declarations of the _CalendarbookDbMonitor class.
24 #ifndef _FSCL_INTERNAL_CALENDARBOOK_DB_MONITOR_H_
25 #define _FSCL_INTERNAL_CALENDARBOOK_DB_MONITOR_H_
27 #include <unique_ptr.h>
28 #include <FBaseTypes.h>
29 #include <FBaseResult.h>
30 #include <FBaseObject.h>
32 namespace Tizen { namespace Base { namespace Runtime
37 namespace Tizen { namespace Social
39 class _ICalendarbookDbChangeEventListener;
40 class _CalendarbookDbChangeEvent;
43 * @class _CalendarbookDbMonitor
44 * @brief This class handles the _CalendarbookDbMonitor operations.
46 * @see _CalendarbookImpl
49 class _CalendarbookDbMonitor
50 : public Tizen::Base::Object
52 class _CalendarbookCallback
55 _CalendarbookCallback(void);
56 ~_CalendarbookCallback(void);
57 result Register(calendar_db_changed_cb callback, void* pUserData);
59 calendar_db_changed_cb __callback;
67 result AddListener(const _ICalendarbookDbChangeEventListener& listener);
69 result RemoveListener(const _ICalendarbookDbChangeEventListener& listener);
71 static _CalendarbookDbMonitor* GetInstance(void);
75 * This constructor is intentionally declared as private to implement the Singleton semantic.
77 _CalendarbookDbMonitor(void);
80 * This destructor is intentionally declared as private to implement the Singleton semantic.
82 virtual ~_CalendarbookDbMonitor(void);
84 result Construct(void);
87 * The implementation of this copy constructor is intentionally blank and declared as private @n
88 * to prohibit copying of objects.
90 _CalendarbookDbMonitor(const _CalendarbookDbMonitor& rhs);
92 static void OnCalendarbookDbChanged(const char* pViewUri, void* pUserData);
94 static void InitCalendarbookDbMonitor(void);
96 _CalendarbookDbMonitor& operator =(const _CalendarbookDbMonitor& rhs);
99 std::unique_ptr<_CalendarbookDbChangeEvent> __pEvent;
100 std::unique_ptr<_CalendarbookCallback> __pChangeCallback;
102 static Tizen::Base::Runtime::Mutex __mutex;
104 static _CalendarbookDbMonitor* __pCalendarbookDbMonitor;
105 friend class std::default_delete<_CalendarbookDbMonitor>;
107 }; // _CalendarbookDbMonitor
111 #endif //_FSCL_INTERNAL_CALENDARBOOK_DB_MONITOR_H_