libscratchcpp
A library for C++ based Scratch project players
Loading...
Searching...
No Matches
textbubble.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2
3#pragma once
4
5#include "drawable.h"
6#include "signal.h"
7
8namespace libscratchcpp
9{
10
11class Thread;
12class TextBubblePrivate;
13
16{
17 public:
18 enum class Type
19 {
22 };
23
24 TextBubble();
25 TextBubble(const TextBubble &) = delete;
26
27 bool isTextBubble() const override final;
28
29 Type type() const;
30 virtual void setType(Type type);
31 sigslot::signal<Type> &typeChanged() const;
32
33 const std::string &text() const;
34 virtual void setText(const std::string &text);
35 virtual void setText(const std::string &text, Thread *owner);
36 sigslot::signal<const std::string &> &textChanged() const;
37
38 Thread *owner() const;
39
40 private:
41 spimpl::unique_impl_ptr<TextBubblePrivate> impl;
42};
43
44} // namespace libscratchcpp
Drawable()
Definition drawable.cpp:10
The TextBubble class represents a text bubble created using say or think block.
Definition textbubble.h:16
Thread * owner() const
Definition textbubble.cpp:96
TextBubble(const TextBubble &)=delete
bool isTextBubble() const override final
Definition textbubble.cpp:18
TextBubble()
Definition textbubble.cpp:11
Type
Definition textbubble.h:19
@ Think
Definition textbubble.h:21
@ Say
Definition textbubble.h:20
Type type() const
Definition textbubble.cpp:24
sigslot::signal< const std::string & > & textChanged() const
Definition textbubble.cpp:90
virtual void setType(Type type)
Definition textbubble.cpp:30
const std::string & text() const
Definition textbubble.cpp:46
virtual void setText(const std::string &text)
Definition textbubble.cpp:55
sigslot::signal< Type > & typeChanged() const
Definition textbubble.cpp:37
The Thread class represents a running Scratch script.
Definition thread.h:19
#define LIBSCRATCHCPP_EXPORT
Definition global.h:17
The main namespace of the library.
Definition asset.h:10