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 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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <dali/public-api/actors/light-actor.h>
23 #include <dali/internal/event/actors/actor-impl.h>
24 #include <dali/internal/event/actor-attachments/light-attachment-impl.h>
33 * An actor with a conveniently pre-attached LightAttachment.
34 * This is the simplest way to add lighting.
36 class LightActor : public Actor
41 * Create an initialised light actor.
42 * @return A smart-pointer to a newly allocated light actor.
44 static LightActorPtr New();
47 * @copydoc Dali::Internal::Actor::OnInitialize
52 * @copydoc Dali::LightActor::SetLight
54 void SetLight(Dali::Light light);
57 * @copydoc Dali::LightActor::GetLight
59 Dali::Light GetLight() const;
62 * @copydoc Dali::LightActor::SetActive
64 void SetActive(bool active);
67 * @copydoc Dali::LightActor::GetActive
71 public: // Default property extensions from ProxyObject
73 * @copydoc Dali::Internal::ProxyObject::GetDefaultPropertyCount()
75 virtual unsigned int GetDefaultPropertyCount() const;
78 * @copydoc Dali::Internal::ProxyObject::GetDefaultPropertyIndices()
80 virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const;
83 * @copydoc Dali::Internal::ProxyObject::GetDefaultPropertyName()
85 virtual const char* GetDefaultPropertyName(Property::Index index) const;
88 * @copydoc Dali::Internal::ProxyObject::GetDefaultPropertyIndex()
90 virtual Property::Index GetDefaultPropertyIndex(const std::string& name) const;
93 * @copydoc Dali::Internal::ProxyObject::IsDefaultPropertyWritable()
95 virtual bool IsDefaultPropertyWritable(Property::Index index) const;
98 * @copydoc Dali::Internal::ProxyObject::IsDefaultPropertyAnimatable()
100 virtual bool IsDefaultPropertyAnimatable(Property::Index index) const;
103 * @copydoc Dali::Internal::ProxyObject::IsDefaultPropertyAConstraintInput()
105 virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const;
108 * @copydoc Dali::Internal::ProxyObject::GetDefaultPropertyType()
110 virtual Property::Type GetDefaultPropertyType(Property::Index index) const;
113 * @copydoc Dali::Internal::ProxyObject::SetDefaultProperty()
115 virtual void SetDefaultProperty(Property::Index index, const Property::Value& propertyValue);
118 * @copydoc Dali::Internal::ProxyObject::GetDefaultProperty()
120 virtual Property::Value GetDefaultProperty( Property::Index index ) const;
125 * Protected constructor; see also LightActor::New()
130 * A reference counted object may only be deleted by calling Unreference()
132 virtual ~LightActor();
136 LightAttachmentPtr mLightAttachment;
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__