Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
canvas-temporary-item.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2#ifndef INKSCAPE_CANVAS_TEMPORARY_ITEM_H
3#define INKSCAPE_CANVAS_TEMPORARY_ITEM_H
4
5/*
6 * Authors:
7 * Johan Engelen
8 *
9 * Copyright (C) Johan Engelen 2008 <j.b.c.engelen@utwente.nl>
10 *
11 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
12 */
13
14#include <sigc++/signal.h>
15#include <sigc++/connection.h>
17#include <sigc++/scoped_connection.h>
18
19namespace Inkscape {
20
21class CanvasItem;
22
23namespace Display {
24
28class TemporaryItem final
29{
30public:
31 TemporaryItem(CanvasItem *item, int lifetime_msecs);
32 TemporaryItem(TemporaryItem const &) = delete;
35
36 sigc::signal<void (TemporaryItem *)> signal_timeout;
37
38protected:
39 friend class TemporaryItemList;
40
42 sigc::scoped_connection timeout_conn;
43};
44
45} //namespace Display
46} //namespace Inkscape
47
48#endif // INKSCAPE_CANVAS_TEMPORARY_ITEM_H
49
50/*
51 Local Variables:
52 mode:c++
53 c-file-style:"stroustrup"
54 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
55 indent-tabs-mode:nil
56 fill-column:99
57 End:
58*/
59// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
std::unique_ptr< T, CanvasItemUnlinkDeleter > CanvasItemPtr
Smart pointer used to hold CanvasItems, like std::unique_ptr.
Provides a class that can contain active TemporaryItems on a desktop.
Provides a class to put a canvasitem temporarily on-canvas.
TemporaryItem(TemporaryItem const &)=delete
CanvasItemPtr< CanvasItem > canvasitem
The item we are holding on to.
sigc::signal< void(TemporaryItem *)> signal_timeout
TemporaryItem & operator=(TemporaryItem const &)=delete
SPItem * item
Helper class to stream background task notifications as a series of messages.