Merge remote-tracking branch 'origin/tizen' into new_text
[platform/core/uifw/dali-toolkit.git] / plugins / dali-script-v8 / src / stage / stage-wrapper.h
1 #ifndef __DALI_V8PLUGIN_STAGE_WRAPPER_H__
2 #define __DALI_V8PLUGIN_STAGE_WRAPPER_H__
3
4 /*
5  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
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 // EXTERNAL INCLUDES
23 #include <v8.h>
24 #include <dali/public-api/common/stage.h>
25
26 // INTERNAL INCLUDES
27 #include <shared/base-wrapped-object.h>
28 #include <signals/signal-manager.h>
29
30
31 namespace Dali
32 {
33
34 namespace V8Plugin
35 {
36
37
38 /**
39  * An Stage  wrapper.
40  * Provides access to Stage specific functionality and V8 memory handling.
41  */
42 class DALI_INTERNAL StageWrapper : public BaseWrappedObject
43 {
44
45 public:
46
47   StageWrapper( const Stage& stage,
48                 GarbageCollectorInterface& gc );
49
50   virtual ~StageWrapper() {};
51
52   /**
53    * Wraps a stage
54    */
55   static v8::Handle<v8::Object> WrapStage(v8::Isolate* isolate, const Dali::Stage& );
56
57   Stage GetStage();
58
59   virtual SignalManager* GetSignalManager() { return &mSignalManager;}
60
61
62 private:
63
64   // Stage
65   Stage mStage;
66   SignalManager mSignalManager;
67
68   static v8::Handle<v8::ObjectTemplate> MakeStageTemplate( v8::Isolate* isolate );
69   static v8::Local<v8::ObjectTemplate> GetStageTemplate( v8::Isolate* isolate );
70
71 };
72
73 } // namespace V8Plugin
74
75 } // namespace Dali
76
77 #endif // __DALI_V8PLUGIN_STAGE_WRAPPER_H__