openshot-audio
0.1.6
JuceLibraryCode
modules
juce_gui_extra
misc
juce_BubbleMessageComponent.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_BUBBLEMESSAGECOMPONENT_H_INCLUDED
26
#define JUCE_BUBBLEMESSAGECOMPONENT_H_INCLUDED
27
28
29
//==============================================================================
38
class
JUCE_API
BubbleMessageComponent
:
public
BubbleComponent
,
39
private
Timer
40
{
41
public
:
42
//==============================================================================
53
BubbleMessageComponent
(
int
fadeOutLengthMs = 150);
54
56
~
BubbleMessageComponent
();
57
58
//==============================================================================
77
void
showAt (
const
Rectangle<int>
& position,
78
const
AttributedString
& message,
79
int
numMillisecondsBeforeRemoving,
80
bool
removeWhenMouseClicked =
true
,
81
bool
deleteSelfAfterUse =
false
);
82
100
void
showAt (
Component
* component,
101
const
AttributedString
& message,
102
int
numMillisecondsBeforeRemoving,
103
bool
removeWhenMouseClicked =
true
,
104
bool
deleteSelfAfterUse =
false
);
105
106
107
//==============================================================================
109
void
getContentSize
(
int
& w,
int
& h);
111
void
paintContent
(
Graphics
& g,
int
w,
int
h);
113
void
timerCallback
();
114
115
private
:
116
//==============================================================================
117
int
fadeOutLength, mouseClickCounter;
118
TextLayout
textLayout;
119
int64
expiryTime;
120
bool
deleteAfterUse;
121
122
void
createLayout (
const
AttributedString
&);
123
void
init (
int
numMillisecondsBeforeRemoving,
124
bool
removeWhenMouseClicked,
125
bool
deleteSelfAfterUse);
126
void
hide (
bool
fadeOut);
127
128
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR
(
BubbleMessageComponent
)
129
};
130
131
132
#endif // JUCE_BUBBLEMESSAGECOMPONENT_H_INCLUDED
TextLayout
Definition:
juce_TextLayout.h:38
Timer::timerCallback
virtual void timerCallback()=0
JUCE_API
#define JUCE_API
Definition:
juce_StandardHeader.h:139
BubbleComponent::getContentSize
virtual void getContentSize(int &width, int &height)=0
Rectangle
Definition:
juce_Rectangle.h:36
Component
Definition:
juce_Component.h:33
int64
long long int64
Definition:
juce_MathsFunctions.h:60
AttributedString
Definition:
juce_AttributedString.h:39
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
Definition:
juce_PlatformDefs.h:198
Graphics
Definition:
juce_GraphicsContext.h:42
BubbleMessageComponent
Definition:
juce_BubbleMessageComponent.h:38
BubbleComponent
Definition:
juce_BubbleComponent.h:44
Timer
Definition:
juce_Timer.h:52
BubbleComponent::paintContent
virtual void paintContent(Graphics &g, int width, int height)=0
Generated by
1.8.13