diff options
Diffstat (limited to 'mobile_src/Calendar/JSCalendarAttendee.h')
-rwxr-xr-x | mobile_src/Calendar/JSCalendarAttendee.h | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/mobile_src/Calendar/JSCalendarAttendee.h b/mobile_src/Calendar/JSCalendarAttendee.h new file mode 100755 index 0000000..547202e --- /dev/null +++ b/mobile_src/Calendar/JSCalendarAttendee.h @@ -0,0 +1,115 @@ +// +// Tizen Web Device API +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + + +#ifndef _JS_CALENDAR_ATTENDEE_H_ +#define _JS_CALENDAR_ATTENDEE_H_ + +#include <string> +#include <vector> +#include <JavaScriptCore/JavaScript.h> +#include <CommonsJavaScript/PrivateObject.h> +#include "CalendarEvent.h" +#include "EventAttendee.h" + +namespace DeviceAPI { +namespace Calendar { + +#define TIZEN_INTERFACE_CALENDAR_ATTENDEE "CalendarAttendee" + +#define TIZEN_ATTENDEE_NAME "name" +#define TIZEN_ATTENDEE_URI "uri" +#define TIZEN_ATTENDEE_ROLE "role" +#define TIZEN_ATTENDEE_STATUS "status" +#define TIZEN_ATTENDEE_RSVP "RSVP" +#define TIZEN_ATTENDEE_TYPE "type" +#define TIZEN_ATTENDEE_GROUP "group" +#define TIZEN_ATTENDEE_DELEGATORURI "delegatorURI" +#define TIZEN_ATTENDEE_DELEGATEURI "delegateURI" +#define TIZEN_ATTENDEE_CONTACT_REF "contactRef" + +typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<EventAttendeePtr, + WrtDeviceApis::CommonsJavaScript::NoOwnership> AttendeePrivateObject; + +class JSCalendarAttendee +{ + public: + + static const JSClassDefinition* getClassInfo(); + + static JSClassRef getClassRef(); + + static JSObjectRef createJSCalendarAttendee(JSContextRef context, EventAttendeePtr event); + + static EventAttendeePtr getPrivateObject(JSObjectRef object); + + static void setPrivateObject(const EventAttendeePtr &attendee, + JSContextRef ctx, + const JSObjectRef object); + + static JSObjectRef constructor(JSContextRef context, + JSObjectRef constructor, + size_t argumentCount, + const JSValueRef arguments[], + JSValueRef* exception); + + private: + + /** + * The callback invoked when an object is first created. + */ + static void initialize(JSContextRef context, JSObjectRef object); + + /** + * The callback invoked when an object is finalized. + */ + static void finalize(JSObjectRef object); + + static JSValueRef getProperty(JSContextRef context, + JSObjectRef object, + JSStringRef propertyName, + JSValueRef* exception); + + static bool setProperty(JSContextRef context, + JSObjectRef object, + JSStringRef propertyName, + JSValueRef value, + JSValueRef* exception); + + static JSClassRef m_jsClassRef; + + /** + * This structure describes a statically declared function property. + */ + static JSStaticFunction m_function[]; + + /** + * This structure contains properties and callbacks that define a type of object. + */ + static JSClassDefinition m_classInfo; + + /** + * This member variable contains the initialization values for the static properties of this class. + * The values are given according to the data structure JSPropertySpec + */ + static JSStaticValue m_property[]; +}; + +} +} + +#endif /* _JS_CALENDAR_ATTENDEE_H_ */ |