Adapt the AIL filter used to new ones
[profile/ivi/ico-uxf-homescreen.git] / lib / system-controller / CicoSCMessage.h
1 /*
2  * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
3  *
4  * This program is licensed under the terms and conditions of the
5  * Apache License, version 2.0.  The full text of the Apache License is at
6  * http://www.apache.org/licenses/LICENSE-2.0
7  *
8  */
9
10 //==========================================================================
11 /**
12  *  @file   CicoSCMessage.h
13  *
14  *  @brief  This file is definition of CicoSCMessage class
15  */
16 //==========================================================================
17 #ifndef __CICO_SC_MESSAGE_H__
18 #define __CICO_SC_MESSAGE_H__
19
20 #include <string>
21
22 #include <json-glib/json-glib.h>
23
24 //==========================================================================
25 //  forward declaration
26 //==========================================================================
27 class CicoSCUwsHandle;
28
29 //==========================================================================
30 /**
31  *  @brief  This class hold communication message
32  */
33 //==========================================================================
34 class CicoSCMessage
35 {
36 public:
37     // default constructor
38     CicoSCMessage();
39
40     // destructor
41     virtual ~CicoSCMessage();
42
43     // get message id
44     unsigned int getId(void);
45
46     // add root object for char pointer type
47     void addRootObject(const char * key, const char * value);
48
49     // add root object for string type
50     void addRootObject(const char * key, const std::string & value);
51
52     // add root object for integer type
53     void addRootObject(const char * key, int value);
54
55     // add argument object for char pointer type
56     void addArgObject(const char * key, const char * value);
57
58     // add argument object for string type
59     void addArgObject(const char * key, const std::string & value);
60
61     // add argument object for integer type
62     void addArgObject(const char * key, int value);
63
64     // add argument object for array type
65     void addArgObject(const char * key);
66
67     // add element to array for char pointer type
68     void addElmArray(const char * value);
69
70     // add element to array for string type
71     void addElmArray(const std::string & value);
72
73     // get destination handle 
74     CicoSCUwsHandle* getHandle(void);
75
76     // set destination handle 
77     void setHandle(CicoSCUwsHandle* handle);
78
79     // get message data
80     virtual const char* getData(void);
81
82     // set application id of destination
83     void setSendToAppid(const std::string & appid);
84
85     // get application id of destination
86     const std::string & getSendToAppid(void);
87
88 private:
89     // assignment operator
90     CicoSCMessage& operator=(const CicoSCMessage &object);
91
92     // copy constructor
93     CicoSCMessage(const CicoSCMessage &object);
94
95 protected:
96     static unsigned int ms_counter;     //!< message id counter
97     int                 m_id;           //!< message id
98     CicoSCUwsHandle     *m_uwsHandle;   //!< communication handler
99     JsonGenerator       *m_generator;   //!< json generator
100     JsonNode            *m_root;        //!< json root node
101     JsonObject          *m_rootObj;     //!< json root objects
102     JsonObject          *m_argObj;      //!< json arg objects
103     JsonArray           *m_array;       //!< json array
104     std::string         m_toAppid;      //!< send to appid
105     std::string         m_data;         //!< json format data
106 };
107 #endif  // __CICO_SC_MESSAGE_H__
108 // vim:set expandtab ts=4 sw=4: