Merge "TextLabel example uses ExpandingButtons" into devel/master
[platform/core/uifw/dali-demo.git] / examples / text-label / expanding-buttons.h
1 #ifndef DALI_DEMO_EXPANDING_BUTTONS_CONTROL_H
2 #define DALI_DEMO_EXPANDING_BUTTONS_CONTROL_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 #include <dali-toolkit/dali-toolkit.h>
21
22 namespace Demo
23 {
24
25 namespace Internal
26 {
27 class ExpandingButtons;
28 }
29
30 /**
31  * Control which toggles between showing and hiding a set of buttons.
32  */
33 class ExpandingButtons : public Dali::Toolkit::Control
34 {
35
36
37 public: // Construction / destruction
38
39   /**
40    * Create an uninitialized handle
41    */
42   ExpandingButtons();
43
44   /**
45    * Create an ExpandingButton control with the default pressed and released visual.
46    */
47   static ExpandingButtons New();
48
49   /**
50    * Destructor. This is non-virtual since derived Handle types must not
51    * contain data or virtual methods
52    */
53   ~ExpandingButtons();
54
55   /**
56    * Copy Constructor
57    */
58   ExpandingButtons( const ExpandingButtons& expandingButtons );
59
60   /**
61    * Assignment Operator
62    */
63   ExpandingButtons& operator=( const ExpandingButtons& expandingButtons );
64
65   /**
66    * Downcast
67    */
68   static ExpandingButtons DownCast( BaseHandle handle );
69
70 public: // API
71
72   /**
73    * Add a control (button) to the Expanding button bar. Will be displayed in order of addition.
74    */
75   void RegisterButton( Control& control );
76
77   /**
78    * Expand the registered buttons out from the main button.
79    */
80   void Expand();
81
82   /**
83    * Collapse the expanded buttons back behind the main button.
84    */
85   void Collapse();
86
87 public: // Signals
88
89   /**
90    * ExpandingButtons signal type
91    */
92    typedef Dali::Signal< bool ( ExpandingButtons ) > ExpandingButtonsSignalType;
93
94   /**
95    * This signal is emitted when the button is going to collapse.
96    */
97   ExpandingButtonsSignalType& CollapsingSignal();
98
99 public: // Not for public use
100
101   /**
102    * Create a handle from an implementation
103    */
104   ExpandingButtons( Internal::ExpandingButtons& implementation );
105
106   /**
107    * Allow the creation of an ExpandingButtons handle from an internal CustomActor pointer
108    */
109   ExpandingButtons( Dali::Internal::CustomActor* internal );
110 };
111
112 } // namespace Demo
113
114 #endif // DALI_DEMO_EXPANDING_BUTTONS_CONTROL_H