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_CONTENT_CHANGE_CALLBACK_H__
19 #define __TIZEN_CONTENT_CHANGE_CALLBACK_H__
25 #include <JavaScriptCore/JavaScript.h>
26 #include <MultiCallbackUserData.h>
29 #include "ImageContent.h"
30 #include "VideoContent.h"
31 #include "AudioContent.h"
33 using namespace DeviceAPI::Common;
38 class ContentChangeCallback
41 ContentChangeCallback(JSContextRef globalCtx, JSObjectRef object);
42 virtual ~ContentChangeCallback();
44 void oncontentadded(ContentPtr content);
45 void oncontentadded(ImageContentPtr content);
46 void oncontentadded(VideoContentPtr content);
47 void oncontentadded(AudioContentPtr content);
49 void oncontentupdated(ContentPtr content);
50 void oncontentupdated(ImageContentPtr content);
51 void oncontentupdated(VideoContentPtr content);
52 void oncontentupdated(AudioContentPtr content);
54 void oncontentremoved(std::string id);
56 JSContextRef getContext() const;
59 MultiCallbackUserData *m_callback;
62 typedef std::shared_ptr<ContentChangeCallback> ContentChangeCallbackPtr;
63 typedef std::list<std::shared_ptr<ContentChangeCallback>> ContentChangeCallbackPtrList;
70 #endif // __TIZEN_CONTENT_CHANGE_CALLBACK_H__