Update copyright year to 2015 for public api: core
[platform/core/uifw/dali-core.git] / dali / public-api / signals / signal-slot-observers.h
1 #ifndef __DALI_SIGNAL_SLOT_OBSERVERS_H__
2 #define __DALI_SIGNAL_SLOT_OBSERVERS_H__
3
4 /*
5  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/common/dali-common.h>
23
24 namespace Dali
25 {
26
27 class SlotObserver;
28 class CallbackBase;
29
30 /**
31  * @brief Abstract interface used by a signal to inform a slot it is disconnecting.
32  *
33  * This will happen if the object owning the signal is destroyed.
34  */
35 class DALI_IMPORT_API SignalObserver
36 {
37 public:
38
39   /**
40    * @brief Constructor.
41    */
42   SignalObserver();
43
44   /**
45    * @brief Virtual destructor.
46    */
47   virtual ~SignalObserver();
48
49   /**
50    * @brief This method is called when the signal is disconnecting.
51    *
52    * @param[in] slotObserver The signal that has disconnected.
53    * @param[in] callback The callback attached to the signal disconnected.
54    */
55   virtual void SignalDisconnected( SlotObserver* slotObserver, CallbackBase* callback ) = 0;
56 };
57
58 /**
59  * @brief Abstract Interface used by a slot to inform a signal it is disconnecting.
60  *
61  * This is used by the slot if wants to disconnect or is deleted.
62  */
63 class DALI_IMPORT_API SlotObserver
64 {
65 public:
66
67   /**
68    * @brief Constructor.
69    */
70   SlotObserver();
71
72   /**
73    * @brief Virtual destructor.
74    */
75   virtual ~SlotObserver();
76
77   /**
78    * @brief This method is called when the slot is disconnecting.
79    *
80    * @param[in] callback The callback attached to the signal disconnected.
81    */
82   virtual void SlotDisconnected( CallbackBase* callback ) = 0;
83 };
84
85 } // namespace Dali
86
87 #endif // __DALI_SIGNAL_SLOT_OBSERVERS_H__