Imported Upstream version 0.9.1
[platform/upstream/iotivity.git] / service / things-manager / sdk / java / jni / tm / inc / jni_action_set.h
1 /******************************************************************
2  *
3  * Copyright 2015 Samsung Electronics All Rights Reserved.
4  *
5  *
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  ******************************************************************/
20
21 /**
22   * @file   jni_action_set.h
23   *
24   * @brief  This file contains the declaration of  JniActionSet class
25   *            and its members related to JniActionSet.
26   */
27
28 #ifndef __JNI_ACTIONSET_H_
29 #define __JNI_ACTIONSET_H_
30
31
32 #include <vector>
33 #include <string>
34
35 #include "ThingsManager.h"
36 #include "ActionSet.h"
37 #include "jni_object.h"
38 #include "jni_action.h"
39
40 using namespace OC;
41 using namespace OIC;
42
43 /**
44  * @class   JniActionSet
45  * @brief   This class provides a set of functions to get and set ActionSet Class member variables
46  *
47  */
48 class JniActionSet : public JObject
49 {
50     public:
51         /**
52          * @brief constructor
53          */
54         JniActionSet(JNIEnv *env, jobject obj);
55
56         /**
57          * @brief constructor
58          */
59         JniActionSet(JNIEnv *env);
60
61         /**
62          * @brief destructor
63          *
64          */
65         ~JniActionSet();
66
67         /**
68          * Retrieves target value from JniActionSet class object
69          *
70          * @param name - ActionSet Name
71          *
72          * @return  Boolean, true on success, otherwise false
73          *
74          */
75         bool getJniActionSetName(std::string &name);
76
77         /**
78          * Sets target value of JniActionSet class object
79          *
80          * @param name - ActionSet Name
81          *
82          * @return  Boolean, true on success, otherwise false
83          *
84          */
85         bool setJniActionSetName(const std::string name);
86
87         /**
88          * Retrieves capability values from JniActionSet class object
89          *
90          * @param actionList - List of Actions
91          *
92          * @return  Boolean, true on success, otherwise false
93          */
94         bool getJniListOfActions(std::vector<OIC::Action *> &actionList);
95
96         /**
97          * Converts actionSet class from java to CPP
98          *
99          * @param env - Default JNI Environment Pointer
100          * @param jnewActionSet - action set
101          *
102          * @return  OIC CPP ActionSet
103          */
104         ActionSet *getActionSet(JNIEnv *env, jobject jnewActionSet);
105
106         /**
107          * Converts Time class from java to CPP
108          *
109          * @param env - Default JNI Environment Pointer
110          * @param jnewActionSet - Java action set
111          * @param pActionSet - CPP action set
112          *
113          * @return  Boolean, true on success, otherwise false
114          */
115         bool setTimeInfo(JNIEnv *env, jobject jnewActionSet, OIC::ActionSet *pActionSet);
116 };
117 #endif  //__JNI_ACTIONSET_H_
118