Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
message-context.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
6/*
7 * Authors:
8 * MenTaLguY <mental@rydia.net>
9 *
10 * Copyright (C) 2004 MenTaLguY
11 *
12 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
13 */
14
15#ifndef INKSCAPE_MESSAGE_CONTEXT_H
16#define INKSCAPE_MESSAGE_CONTEXT_H
17
18#include <cstdarg>
19#include <memory>
20#include <glib.h>
21
22#include "message.h"
23
24namespace Inkscape {
25
26class MessageStack;
27
38{
39public:
49
55 void set(MessageType type, char const *message);
56
63 void setF(MessageType type, char const *format, ...) G_GNUC_PRINTF(3,4);
64
72 void setVF(MessageType type, char const *format, va_list args);
73
80 void flash(MessageType type, char const *message);
81
89 void flashF(MessageType type, char const *format, ...) G_GNUC_PRINTF(3,4);
90
99 void flashVF(MessageType type, char const *format, va_list args);
100
102 void clear();
103
104private:
108};
109
110} // namespace Inkscape
111
112#endif // INKSCAPE_MESSAGE_CONTEXT_H
113
114/*
115 Local Variables:
116 mode:c++
117 c-file-style:"stroustrup"
118 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
119 indent-tabs-mode:nil
120 fill-column:99
121 End:
122*/
123// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
A convenience class for working with MessageStacks.
void flashF(MessageType type, char const *format,...) G_GNUC_PRINTF(3
pushes a message onto the stack for a brief period of time using printf-style formatting,...
MessageId _flash_message_id
current flashed message id, or 0
MessageStack * _stack
the message stack to use
void void flashVF(MessageType type, char const *format, va_list args)
pushes a message onto the stack for a brief period of time using printf-style formatting and a stdarg...
void flash(MessageType type, char const *message)
pushes a message onto the stack for a brief period of time without disturbing our "current" message
void void setVF(MessageType type, char const *format, va_list args)
pushes a message on the stack using printf-style formatting, and a stdarg argument list
void setF(MessageType type, char const *format,...) G_GNUC_PRINTF(3
pushes a message on the stack using prinf-style formatting, and replacing our old message
MessageId _message_id
our current message id, or 0
void clear()
removes our current message from the stack
A class which holds a stack of displayed messages.
Helper class to stream background task notifications as a series of messages.
std::uint_least32_t MessageId
An integer ID which identifies a displayed message in a particular Inkscape::MessageStack.
Definition message.h:39
MessageType
A hint about the meaning of a message; is it an ordinary message, a message advising the user of some...
Definition message.h:25
int G_GNUC_PRINTF(2, 3) safeprintf(char(&buf)[N]
Gtk::Stack & stack