tizen beta release
[framework/web/wrt-plugins-common.git] / src / modules / tizen / Messaging / ISendingObserver.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  *
18  *
19  * @file       ISendingObserver.h
20  * @author     Krzysztof Jackiewicz (k.jackiewicz@samsung.com)
21  * @version    0.1
22  * @brief
23  */
24
25 #ifndef ISENDINGOBSERVER_H_
26 #define ISENDINGOBSERVER_H_
27
28 #include "CallbackMgr.h"
29
30 extern "C" {
31 #include <MsgTransportTypes.h>
32 }
33
34 namespace WrtDeviceApis {
35 namespace Messaging {
36 /*
37  *
38  */
39 class ISendingObserver
40 {
41   public:
42     ISendingObserver() : m_reqId(0)
43     {
44     }
45
46     virtual ~ISendingObserver()
47     {
48         if (m_reqId) {
49             CallbackMgrSingleton::Instance().unregister(m_reqId);
50         }
51     }
52
53     void setSendigRequestId(int id)
54     {
55         m_reqId = id;
56     }
57
58     void setRecipient(const char* arg)
59     {
60         m_recipient = arg;
61     }
62
63     std::string getRecipient() const
64     {
65         return m_recipient;
66     }
67
68     virtual void sendingCallback(MSG_SENT_STATUS_S *sent_status) = 0;
69
70   private:
71     int m_reqId;
72     std::string m_recipient;
73 };
74 }
75 }
76
77 #endif /* ISENDINGOBSERVER_H_ */