openshot-audio  0.1.2
juce_PropertyPanel.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_PROPERTYPANEL_H_INCLUDED
26 #define JUCE_PROPERTYPANEL_H_INCLUDED
27 
28 
29 //==============================================================================
42 {
43 public:
44  //==============================================================================
46  PropertyPanel();
47 
49  PropertyPanel (const String& name);
50 
52  ~PropertyPanel();
53 
54  //==============================================================================
56  void clear();
57 
66  void addProperties (const Array<PropertyComponent*>& newPropertyComponents);
67 
79  void addSection (const String& sectionTitle,
80  const Array<PropertyComponent*>& newPropertyComponents,
81  bool shouldSectionInitiallyBeOpen = true,
82  int indexToInsertAt = -1);
83 
85  void refreshAll() const;
86 
88  bool isEmpty() const;
89 
93  int getTotalContentHeight() const;
94 
95  //==============================================================================
99  StringArray getSectionNames() const;
100 
104  bool isSectionOpen (int sectionIndex) const;
105 
109  void setSectionOpen (int sectionIndex, bool shouldBeOpen);
110 
114  void setSectionEnabled (int sectionIndex, bool shouldBeEnabled);
115 
119  void removeSection (int sectionIndex);
120 
121  //==============================================================================
129  XmlElement* getOpennessState() const;
130 
139  void restoreOpennessState (const XmlElement& newState);
140 
141  //==============================================================================
145  void setMessageWhenEmpty (const String& newMessage);
146 
150  const String& getMessageWhenEmpty() const noexcept;
151 
152  //==============================================================================
154  void paint (Graphics&) override;
156  void resized() override;
157 
158 private:
159  Viewport viewport;
160  struct SectionComponent;
162  PropertyHolderComponent* propertyHolderComponent;
163  String messageWhenEmpty;
164 
165  void init();
166  void updatePropHolderLayout() const;
167  void updatePropHolderLayout (int width) const;
168 
170 };
171 
172 
173 #endif // JUCE_PROPERTYPANEL_H_INCLUDED
#define noexcept
Definition: juce_CompilerSupport.h:141
Definition: juce_PropertyPanel.h:41
Definition: juce_String.h:43
Definition: juce_PropertyPanel.cpp:25
#define JUCE_API
Definition: juce_StandardHeader.h:139
virtual void resized()
Definition: juce_Component.cpp:2272
Definition: juce_XmlElement.h:142
virtual void paint(Graphics &g)
Definition: juce_Component.cpp:1929
Definition: juce_Component.h:33
png_const_structrp png_const_inforp int png_fixed_point * width
Definition: juce_PNGLoader.cpp:2339
Definition: juce_StringArray.h:39
Definition: juce_Array.h:60
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
Definition: juce_PlatformDefs.h:198
Definition: juce_GraphicsContext.h:42
Definition: juce_Viewport.h:42
Definition: juce_PropertyPanel.cpp:119