1 #ifndef __DALI_INTERNAL_ACTOR_ATTACHMENT_H__
2 #define __DALI_INTERNAL_ACTOR_ATTACHMENT_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/object/ref-object.h>
33 * An abstract base class for attachments, such a renderable objects and lights.
34 * ActorAttachments must be attached to an actor, in order to be displayed.
36 class ActorAttachment : public Dali::RefObject
41 * Query whether the attachment is connected to the stage.
42 * @return True if the attachment is connected to the stage.
47 * Called by the attached actor, when connected to the Stage.
52 * Called by the attached actor, when the actor is disconnected from the Stage.
57 * Sets whether a renderable attachment is visible.
58 * By default attachments are visible.
59 * @param[in] visible True if the object is visible.
61 void SetVisible(bool visible);
64 * Retrieve whether a renderable attachment is visible.
65 * @return True if the object is visible.
67 bool IsVisible() const;
72 * Construct a new attachment.
73 * @param[in] stage Used to send messages to scene-graph.
75 ActorAttachment( Stage& stage );
78 * A reference counted object may only be deleted by calling Unreference()
80 virtual ~ActorAttachment();
85 ActorAttachment(const ActorAttachment&);
88 ActorAttachment& operator=(const ActorAttachment& rhs);
91 * For use in derived classes, called after ConnectToStage()
93 virtual void OnStageConnection() = 0;
96 * For use in derived classes, called after DisconnectFromStage()
98 virtual void OnStageDisconnection() = 0;
102 Stage* mStage; ///< Used to send messages to scene-graph; valid until Core destruction
104 bool mIsOnStage : 1; ///< Flag to identify whether the attachment is on-stage
107 } // namespace Internal
111 #endif // __DALI_INTERNAL_ACTOR_ATTACHMENT_H__