33065c4facd25566c5625429afa2b01107c24834
[platform/core/uifw/dali-demo.git] / examples / layouting / example.h
1 #ifndef DALI_DEMO_LAYOUTING_EXAMPLE_H
2 #define DALI_DEMO_LAYOUTING_EXAMPLE_H
3
4 /*
5  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <string>
23
24 namespace Demo
25 {
26
27 /**
28  * @brief Abstract base class for layouting examples.
29  */
30 class Example
31 {
32 public:
33   /// Should be overridden by deriving classes to create the required Layouting example
34   virtual void Create() = 0;
35
36   /// Should be overridden by deriving classes to remove their layouting example from stage
37   virtual void Remove() = 0;
38
39   /// Virtual destructor
40   virtual ~Example() = default;
41
42   /**
43    * Gets the title set for this example
44    * @return title
45    */
46   const std::string& GetExampleTitle() const
47   {
48     return mTitle;
49   }
50
51 protected:
52   /**
53    * Constructor for Example
54    * @param[in] title Title to be used for the example
55    */
56   Example( const std::string& title )
57   : mTitle( title )
58   {
59   }
60
61 private:
62   const std::string mTitle;
63 };
64
65 } // namespace Demo
66
67 #endif // DALI_DEMO_LAYOUTING_EXAMPLE_H