Merge "Add the exception handling when using manual cert mode" into tizen_2.1
[platform/framework/native/net.git] / src / FNet_DnsEvent.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17 /**
18  * @file                FNetDns_DnsEvent.h
19  * @brief               This is the header file for the _DnsEvent Class.
20  *
21  * This header file contains declaration of the _DnsEvent Class.
22  * The _DnsEvent class can call a method of a listener (IDnsEventListener object).
23  * So, when a Dns event is occurred, an application can handle it appropriately.
24  */
25 #ifndef _FNET_INTERNAL_DNS_EVENT_H_
26 #define _FNET_INTERNAL_DNS_EVENT_H_
27
28 #include <FBaseDataType.h>
29 #include <FBaseRt_Event.h>
30
31 namespace Tizen { namespace Net
32 {
33
34 class Dns;
35 /**
36  * @class       _DnsEvent
37  * @brief       This class handles Dns events.
38  *
39  * @since 2.1
40  * When a Dns event occurs, the _DnsEvent object finds a IDnsEventListener object
41  * which is registered for the Dns object and calls an appropriate method of the listener.
42  */
43 class _DnsEvent
44         : public Tizen::Base::Runtime::_Event
45 {
46
47 public:
48         /*
49          * This is the default constructor.
50          *
51          * @remarks             After creating an instance of this class, you must explicitly call the
52          *                              construction method to initialize the instance.
53          * @see                 Construct
54          */
55         _DnsEvent(void);
56
57         /*
58          * This is the class destructor.
59          */
60         virtual ~_DnsEvent(void);
61
62         /*
63          * Construct.
64          */
65         result Construct(void);
66         
67 protected:
68         /*
69          * Checks the arg and finds out the type of event. After that this method calls appropriate
70          * listener's method.
71          *
72          * @return              A result code.
73          * @param[in]   listener                        It is a event listener related to this Dns event.
74          * @param[in]   arg                                     It is an argument-like instance of dns event which will be retransmitted to the listener's method as an argument.
75          * @exception   E_SUCCESS                       - The method is successful.
76          * @exception   E_INVALID_ARG           - The argument passed to a method contains an invalid value.@n
77          */
78         void FireImpl(Tizen::Base::Runtime::IEventListener& listener, const Tizen::Base::Runtime::IEventArg& arg);
79
80
81 private:
82         /*
83          * This is the copy constructor.
84          *
85          * @param[in]   rhs     An instance of DnsEvent
86          */
87         _DnsEvent(const _DnsEvent& rhs);
88
89         /*
90          * This is the assignment operator.
91          *
92          * @param[in]   rhs             An instance of Socket
93          */
94         _DnsEvent& operator =(const _DnsEvent& rhs);
95 }; // _DnsEvent
96
97 } } //Tizen::Net
98
99 #endif // _FNET_INTERNAL_DNS_EVENT_H_