Button Refactoring phase 1
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / buttons / check-box-button-impl.h
1 #ifndef __DALI_TOOLKIT_INTERNAL_CHECK_BOX_BUTTON_H__
2 #define __DALI_TOOLKIT_INTERNAL_CHECK_BOX_BUTTON_H__
3
4 /*
5  * Copyright (c) 2014 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 // INTERNAL INCLUDES
22 #include <dali/public-api/common/dali-vector.h>
23
24 #include <dali-toolkit/public-api/controls/buttons/check-box-button.h>
25
26 #include "button-impl.h"
27
28 namespace Dali
29 {
30
31 namespace Toolkit
32 {
33
34 namespace Internal
35 {
36
37 /**
38  * CheckBoxButton implementation class.
39  *
40  * \sa Dali::Toolkit::CheckBoxButton
41  */
42 class CheckBoxButton : public Button
43 {
44 public:
45
46   /**
47    * Create a new CheckBoxButton.
48    * @return A smart-pointer to the newly allocated CheckBoxButton.
49    */
50   static Dali::Toolkit::CheckBoxButton New();
51
52 protected:
53
54   /**
55    * Construct a new CheckBoxButton.
56    */
57   CheckBoxButton();
58
59   /**
60    * A reference counted object may only be deleted by calling Unreference()
61    */
62   virtual ~CheckBoxButton();
63
64 private:
65
66   // Undefined
67   CheckBoxButton( const CheckBoxButton& );
68
69   // Undefined
70   CheckBoxButton& operator=( const CheckBoxButton& );
71 };
72
73 } // namespace Internal
74
75 // Helpers for public-api forwarding methods
76
77 inline Toolkit::Internal::CheckBoxButton& GetImplementation( Toolkit::CheckBoxButton& button )
78 {
79   DALI_ASSERT_ALWAYS( button );
80
81   Dali::RefObject& handle = button.GetImplementation();
82
83   return static_cast<Toolkit::Internal::CheckBoxButton&>( handle );
84 }
85
86 inline const Toolkit::Internal::CheckBoxButton& GetImplementation( const Toolkit::CheckBoxButton& button )
87 {
88   DALI_ASSERT_ALWAYS( button );
89
90   const Dali::RefObject& handle = button.GetImplementation();
91
92   return static_cast<const Toolkit::Internal::CheckBoxButton&>( handle );
93 }
94
95 } // namespace Toolkit
96
97 } // namespace Dali
98
99 #endif // __DALI_TOOLKIT_INTERNAL_CHECK_BOX_BUTTON_H__