openshot-audio  0.1.6
juce_ConcertinaPanel.h
Go to the documentation of this file.
1 /*
2  ==============================================================================
3 
4  This file is part of the JUCE library.
5  Copyright (c) 2015 - ROLI Ltd.
6 
7  Permission is granted to use this software under the terms of either:
8  a) the GPL v2 (or any later version)
9  b) the Affero GPL v3
10 
11  Details of these licenses can be found at: www.gnu.org/licenses
12 
13  JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
14  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15  A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 
17  ------------------------------------------------------------------------------
18 
19  To release a closed-source product which uses JUCE, commercial licenses are
20  available: visit www.juce.com for more information.
21 
22  ==============================================================================
23 */
24 
25 #ifndef JUCE_CONCERTINAPANEL_H_INCLUDED
26 #define JUCE_CONCERTINAPANEL_H_INCLUDED
27 
28 
29 //==============================================================================
38 {
39 public:
44 
46  ~ConcertinaPanel();
47 
57  void addPanel (int insertIndex, Component* component, bool takeOwnership);
58 
63  void removePanel (Component* panelComponent);
64 
68  int getNumPanels() const noexcept;
69 
73  Component* getPanel (int index) const noexcept;
74 
80  bool setPanelSize (Component* panelComponent, int newHeight, bool animate);
81 
88  bool expandPanelFully (Component* panelComponent, bool animate);
89 
91  void setMaximumPanelSize (Component* panelComponent, int maximumSize);
92 
94  void setPanelHeaderSize (Component* panelComponent, int headerSize);
95 
96  //==============================================================================
99  {
100  virtual ~LookAndFeelMethods() {}
101 
102  virtual void drawConcertinaPanelHeader (Graphics&, const Rectangle<int>& area,
103  bool isMouseOver, bool isMouseDown,
104  ConcertinaPanel&, Component&) = 0;
105  };
106 
107 private:
108  void resized() override;
109 
110  class PanelHolder;
111  struct PanelSizes;
112  friend class PanelHolder;
113  friend struct PanelSizes;
116 
117  ScopedPointer<PanelSizes> currentSizes;
118  OwnedArray<PanelHolder> holders;
119  ComponentAnimator animator;
120  int headerHeight;
121 
122  int indexOfComp (Component*) const noexcept;
123  PanelSizes getFittedSizes() const;
124  void applyLayout (const PanelSizes&, bool animate);
125  void setLayout (const PanelSizes&, bool animate);
126  void panelHeaderDoubleClicked (Component*);
127 
129 };
130 
131 
132 #endif // JUCE_CONCERTINAPANEL_H_INCLUDED
#define noexcept
Definition: juce_CompilerSupport.h:141
Definition: juce_ConcertinaPanel.cpp:209
Definition: juce_ConcertinaPanel.h:98
Definition: juce_ConcertinaPanel.h:37
#define JUCE_API
Definition: juce_StandardHeader.h:139
#define const
Definition: juce_ConcertinaPanel.cpp:25
Definition: juce_ComponentAnimator.h:50
Definition: juce_Rectangle.h:36
virtual ~LookAndFeelMethods()
Definition: juce_ConcertinaPanel.h:100
Definition: juce_Component.h:33
Definition: juce_ScopedPointer.h:70
Definition: juce_ContainerDeletePolicy.h:44
Definition: juce_OwnedArray.h:55
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
Definition: juce_PlatformDefs.h:198
Definition: juce_GraphicsContext.h:42