1 #ifndef __DALI_INTERNAL_LIGHT_ACTOR_H__
2 #define __DALI_INTERNAL_LIGHT_ACTOR_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 // Licensed under the Flora License, Version 1.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
11 // http://floralicense.org/license/
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.
21 #include <dali/public-api/actors/light-actor.h>
22 #include <dali/internal/event/actors/actor-impl.h>
23 #include <dali/internal/event/actor-attachments/light-attachment-impl.h>
32 * An actor with a conveniently pre-attached LightAttachment.
33 * This is the simplest way to add lighting.
35 class LightActor : public Actor
40 * Create an initialised light actor.
41 * @return A smart-pointer to a newly allocated light actor.
43 static LightActorPtr New();
46 * @copydoc Dali::Internal::Actor::OnInitialize
51 * @copydoc Dali::LightActor::SetLight
53 void SetLight(Dali::Light light);
56 * @copydoc Dali::LightActor::GetLight
58 Dali::Light GetLight() const;
61 * @copydoc Dali::LightActor::SetActive
63 void SetActive(bool active);
66 * @copydoc Dali::LightActor::GetActive
70 public: // Default property extensions from ProxyObject
72 * @copydoc Dali::Internal::ProxyObject::GetDefaultPropertyCount()
74 virtual unsigned int GetDefaultPropertyCount() const;
77 * @copydoc Dali::Internal::ProxyObject::GetDefaultPropertyIndices()
79 virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const;
82 * @copydoc Dali::Internal::ProxyObject::GetDefaultPropertyName()
84 virtual const std::string& GetDefaultPropertyName(Property::Index index) const;
87 * @copydoc Dali::Internal::ProxyObject::GetDefaultPropertyIndex()
89 virtual Property::Index GetDefaultPropertyIndex(const std::string& name) const;
92 * @copydoc Dali::Internal::ProxyObject::IsDefaultPropertyWritable()
94 virtual bool IsDefaultPropertyWritable(Property::Index index) const;
97 * @copydoc Dali::Internal::ProxyObject::IsDefaultPropertyAnimatable()
99 virtual bool IsDefaultPropertyAnimatable(Property::Index index) const;
102 * @copydoc Dali::Internal::ProxyObject::IsDefaultPropertyAConstraintInput()
104 virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const;
107 * @copydoc Dali::Internal::ProxyObject::GetDefaultPropertyType()
109 virtual Property::Type GetDefaultPropertyType(Property::Index index) const;
112 * @copydoc Dali::Internal::ProxyObject::SetDefaultProperty()
114 virtual void SetDefaultProperty(Property::Index index, const Property::Value& propertyValue);
117 * @copydoc Dali::Internal::ProxyObject::GetDefaultProperty()
119 virtual Property::Value GetDefaultProperty( Property::Index index ) const;
124 * Protected constructor; see also LightActor::New()
129 * A reference counted object may only be deleted by calling Unreference()
131 virtual ~LightActor();
135 LightAttachmentPtr mLightAttachment;
137 static bool mFirstInstance ;
138 static DefaultPropertyLookup* mDefaultLightActorPropertyLookup; ///< Default properties
141 } // namespace Internal
143 // Helpers for public-api forwarding methods
145 inline Internal::LightActor& GetImplementation(Dali::LightActor& light)
147 DALI_ASSERT_ALWAYS( light && "LightActor handle is empty" );
149 BaseObject& handle = light.GetBaseObject();
151 return static_cast<Internal::LightActor&>(handle);
154 inline const Internal::LightActor& GetImplementation(const Dali::LightActor& light)
156 DALI_ASSERT_ALWAYS( light && "LightActor handle is empty" );
158 const BaseObject& handle = light.GetBaseObject();
160 return static_cast<const Internal::LightActor&>(handle);
165 #endif // __DALI_INTERNAL_LIGHT_ACTOR_H__