fbfc34fb466a94e5c6dddac00f984a25cd5a5079
[framework/web/wrt-plugins-common.git] / src / modules / tizen / Messaging / NetworkStatus.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  * @author          Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
18  */
19
20 #ifndef NETWORKSTATUS_H_
21 #define NETWORKSTATUS_H_
22
23 #include <string>
24 #include <dpl/noncopyable.h>
25 #include <dpl/shared_ptr.h>
26 #include <DBus/Message.h>
27
28 namespace WrtDeviceApis {
29 namespace Messaging {
30 class NetworkStatus : private DPL::Noncopyable
31 {
32   public:
33     explicit NetworkStatus(const DBus::MessagePtr& message);
34
35     int getStatus() const;
36     int getAccountId() const;
37     std::string getSource() const;
38     int getMailId() const;
39     int getErrorCode() const;
40
41   private:
42     void initialize(const DBus::MessagePtr& message);
43
44   private:
45     int m_status;
46     int m_accountId;
47     /*
48      * Not sure what it stores. According to source code of Email application
49      * it can contain string "ACTIVESYNC" or name of the file which stores body.
50      */
51     std::string m_source;
52     int m_mailId;
53     int m_errorCode;
54 };
55
56 typedef DPL::SharedPtr<NetworkStatus> NetworkStatusPtr;
57 }
58 }
59
60 #endif // NETWORKSTATUS_H_