2159bb1cad29a2a4dc34ef78d0025eb5d83edeff
[framework/web/wrt-plugins-common.git] / src / modules / API / Messaging / EventOnSendingFailed.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 /**
17  * @file       EventOnSendingFailed.h
18  * @author     Krzysztof Jackiewicz (k.jackiewicz@samsung.com)
19  * @version    0.1
20  * @brief
21  */
22
23 #ifndef EVENTONSENDINGFAILED_H_
24 #define EVENTONSENDINGFAILED_H_
25
26 #include <dpl/shared_ptr.h>
27 #include <Commons/EventListener.h>
28 #include <Commons/ListenerEventEmitter.h>
29
30 namespace WrtDeviceApis {
31 namespace Messaging {
32 namespace Api {
33 /*
34  *
35  */
36 class EventOnSendingFailed : public Commons::ListenerEvent<
37         EventOnSendingFailed>
38 {
39   public:
40     typedef enum
41     {
42         NO_NETWORKING,
43         NO_CONNECTION,
44         BAD_PAYLOAD,
45         UNKNOWN
46     } ErrorCode;
47
48     EventOnSendingFailed()
49     {
50     }
51
52     void setError(ErrorCode error)
53     {
54         m_error = error;
55     }
56
57     ErrorCode getError() const
58     {
59         return m_error;
60     }
61
62   private:
63     ErrorCode m_error;
64 };
65
66 typedef DPL::SharedPtr<EventOnSendingFailed> EventOnSendingFailedPtr;
67 typedef Commons::ListenerEventEmitter<EventOnSendingFailed>
68 EventOnSendingFailedEmitter;
69 typedef DPL::SharedPtr<EventOnSendingFailedEmitter>
70 EventOnSendingFailedEmitterPtr;
71 } // Api
72 } // WrtDeviceApis
73 }
74 #endif /* EVENTONSENDINGFAILED_H_ */