2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 #ifndef __TIZEN_BLUETOOTH_SERVICE_HANDLER_H__
19 #define __TIZEN_BLUETOOTH_SERVICE_HANDLER_H__
22 #include <JavaScriptCore/JavaScript.h>
24 //#include <boost/shared_ptr.hpp>
25 #include <MultiCallbackUserData.h>
26 #include <PropertyBag.h>
32 class BluetoothServiceHandler : public Common::SecurityAccessor
35 BluetoothServiceHandler(std::string uuid, std::string name, int registeredSocket);
36 virtual ~BluetoothServiceHandler();
38 std::string getUUID() const;
39 std::string getName() const;
40 int getRegisteredSocket() const;
41 bool getConnectionState() const;
42 Common::MultiCallbackUserDataPtr getOnConnect() const;
43 JSValueRef getOnConnect(JSContextRef context);
45 void setConnectionState(bool isConnected);
46 bool setOnConnect(JSContextRef context, JSObjectRef onConnect);
48 void unregister(Common::MultiCallbackUserDataPtr userData);
53 int mRegisteredSocket;
56 Common::MultiCallbackUserDataPtr mOnConnect;
57 Common::PropertyBag mLocalProperty;
60 typedef BluetoothServiceHandler* BluetoothServiceHandlerPtr;
65 #endif // __TIZEN_BLUETOOTH_SERVICE_HANDLER_H__