openshot-audio  0.1.2
juce_BubbleComponent.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_BUBBLECOMPONENT_H_INCLUDED
26 #define JUCE_BUBBLECOMPONENT_H_INCLUDED
27 
28 
29 //==============================================================================
45 {
46 protected:
47  //==============================================================================
54 
55 public:
57  ~BubbleComponent();
58 
59  //==============================================================================
66  {
67  above = 1,
68  below = 2,
69  left = 4,
70  right = 8
71  };
72 
85  void setAllowedPlacement (int newPlacement);
86 
87  //==============================================================================
97  void setPosition (Component* componentToPointTo);
98 
110  void setPosition (Point<int> arrowTipPosition);
111 
123  void setPosition (const Rectangle<int>& rectangleToPointTo);
124 
125  //==============================================================================
134  {
135  backgroundColourId = 0x1000af0,
136  outlineColourId = 0x1000af1
137  };
138 
139 
140  //==============================================================================
144  {
145  virtual ~LookAndFeelMethods() {}
146 
147  virtual void drawBubble (Graphics&, BubbleComponent&,
148  const Point<float>& positionOfTip,
149  const Rectangle<float>& body) = 0;
150  };
151 
152 protected:
153  //==============================================================================
157  virtual void getContentSize (int& width, int& height) = 0;
158 
164  virtual void paintContent (Graphics& g, int width, int height) = 0;
165 
166 public:
168  void paint (Graphics&) override;
169 
170 private:
171  Rectangle<int> content;
172  Point<int> arrowTip;
173  int allowablePlacements;
174  DropShadowEffect shadow;
175 
177 };
178 
179 
180 #endif // JUCE_BUBBLECOMPONENT_H_INCLUDED
Definition: juce_Point.h:39
#define JUCE_API
Definition: juce_StandardHeader.h:139
Definition: juce_Rectangle.h:36
Definition: juce_DropShadowEffect.h:81
Definition: juce_Component.h:33
Definition: juce_BubbleComponent.h:143
png_const_structrp png_const_inforp int png_fixed_point * width
Definition: juce_PNGLoader.cpp:2339
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
Definition: juce_PlatformDefs.h:198
Definition: juce_GraphicsContext.h:42
ColourIds
Definition: juce_BubbleComponent.h:133
BubblePlacement
Definition: juce_BubbleComponent.h:65
Definition: juce_BubbleComponent.h:44
virtual ~LookAndFeelMethods()
Definition: juce_BubbleComponent.h:145