1 #ifndef DALI_INTERNAL_EXAMPLE_CLASS_H
2 #define DALI_INTERNAL_EXAMPLE_CLASS_H
5 * Copyright (c) 2021 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>
30 // Forward declarations for the Dali namespace
35 // Forward declarations for the Dali::Internal namespace
39 * TODO - Rewrite this comment, to explain the purpose of your class
41 class ExampleClass : public ExampleBaseClass
44 typedef std::list<XXXX> ExampleContainer;
48 FirstValue = 0, ///< First value description
49 SecondValue = 1 ///< Second value description
52 public: // Construction
54 * Create an ExampleClass.
59 * Create an ExampleClass with a name.
60 * @param[in] The name of the example class.
62 ExampleClass(const std::string& name);
65 * Virtual destructor; ExampleClass is intended as a base class.
67 virtual ~ExampleClass();
69 public: // Public members
71 * Set the name of an ExampleClass.
72 * @pre TODO - Edit this example comment.
73 * @param[in] The new name.
74 * @post TODO - Edit this example comment.
79 * Retreive the name of an ExampleClass.
80 * @pre TODO - Edit this example comment.
81 * @return The name of the example class.
82 * @post TODO - Edit this example comment.
84 std::string GetName() const
89 protected: // Protected members
91 * Example helper method, which is accessible by derived classes.
92 * @param [in] exampleParam An an example parameter.
94 void HelperMember(ExampleEnum exampleParam);
96 private: // Private members
98 * Undefined copy constructor; declaring this prevents accidental copying.
99 * @param[in] A reference to the ExampleClass to copy.
101 ExampleClass(const ExampleClass&);
104 * Undefined assignment operator; declaring this prevents accidental copying.
105 * @param[in] A reference to the ExampleClass to copy.
106 * @return A reference to the copied ExampleClass.
108 ExampleClass& operator=(const ExampleClass& rhs);
111 * Example pure virtual member.
112 * The intention here is to avoid making the public SetName() virtual.
113 * When the name changes, derived classes receive this notification.
115 virtual void OnNameSet() = 0;
117 protected: // Protected data
118 ExampleContainer mContainer;
120 private: // Private data
124 } // namespace Internal
126 // Helpers for public-api forwarding methods
128 inline Internal::ExampleClass& GetImplementation(Dali::ExampleClass& example)
130 DALI_ASSERT(example);
132 BaseObject& handle = example.GetBaseObject();
134 return static_cast<Internal::ExampleClass&>(handle);
137 inline const Internal::ExampleClass& GetImplementation(const Dali::ExampleClass& example)
139 DALI_ASSERT(example);
141 const BaseObject& handle = example.GetBaseObject();
143 return static_cast<const Internal::ExampleClass&>(handle);
148 #endif // DALI_INTERNAL_EXAMPLE_CLASS_H