1 #ifndef __DALI_INTERNAL_EXAMPLE_CLASS_H__
2 #define __DALI_INTERNAL_EXAMPLE_CLASS_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.
26 #include <dali/public-api/core/actors/actor.h>
31 // Forward declarations for the Dali namespace
37 // Forward declarations for the Dali::Internal namespace
41 * TODO - Rewrite this comment, to explain the purpose of your class
43 class ExampleClass : public ExampleBaseClass
47 typedef std::list<XXXX> ExampleContainer;
51 FirstValue = 0, ///< First value description
52 SecondValue = 1 ///< Second value description
55 public: // Construction
58 * Create an ExampleClass.
63 * Create an ExampleClass with a name.
64 * @param[in] The name of the example class.
66 ExampleClass(const std::string& name);
69 * Virtual destructor; ExampleClass is intended as a base class.
71 virtual ~ExampleClass();
73 public: // Public members
76 * Set the name of an ExampleClass.
77 * @pre TODO - Edit this example comment.
78 * @param[in] The new name.
79 * @post TODO - Edit this example comment.
84 * Retreive the name of an ExampleClass.
85 * @pre TODO - Edit this example comment.
86 * @return The name of the example class.
87 * @post TODO - Edit this example comment.
89 std::string GetName() const { return mName; }
91 protected: // Protected members
94 * Example helper method, which is accessible by derived classes.
95 * @param [in] exampleParam An an example parameter.
97 void HelperMember(ExampleEnum exampleParam);
99 private: // Private members
102 * Undefined copy constructor; declaring this prevents accidental copying.
103 * @param[in] A reference to the ExampleClass to copy.
105 ExampleClass(const ExampleClass&);
108 * Undefined assignment operator; declaring this prevents accidental copying.
109 * @param[in] A reference to the ExampleClass to copy.
110 * @return A reference to the copied ExampleClass.
112 ExampleClass& operator=(const ExampleClass& rhs);
115 * Example pure virtual member.
116 * The intention here is to avoid making the public SetName() virtual.
117 * When the name changes, derived classes receive this notification.
119 virtual void OnNameSet() = 0;
121 protected: // Protected data
123 ExampleContainer mContainer;
125 private: // Private data
130 } // namespace Internal
132 // Helpers for public-api forwarding methods
134 inline Internal::ExampleClass& GetImplementation(Dali::ExampleClass& example)
136 DALI_ASSERT(example);
138 BaseObject& handle = example.GetBaseObject();
140 return static_cast<Internal::ExampleClass&>(handle);
143 inline const Internal::ExampleClass& GetImplementation(const Dali::ExampleClass& example)
145 DALI_ASSERT(example);
147 const BaseObject& handle = example.GetBaseObject();
149 return static_cast<const Internal::ExampleClass&>(handle);
154 #endif // __DALI_INTERNAL_EXAMPLE_CLASS_H__