message-stack.h revision 7e2ff3ea648910ad5555bdebf85d16e90bb2962a
/** \file
* Raw stack of active status messages
*/
/*
* Authors:
* MenTaLguY <mental@rydia.net>
*
* Copyright (C) 2004 MenTaLguY
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifndef SEEN_INKSCAPE_MESSAGE_STACK_H
#define SEEN_INKSCAPE_MESSAGE_STACK_H
#include <stdarg.h>
#include "gc-managed.h"
#include "gc-finalized.h"
#include "gc-anchored.h"
#include "message.h"
/**
* A class which holds a stack of displayed messages.
*
* Messages can be pushed onto the top of the stack, and removed
* from any point in the stack by their id.
*
* Messages may also be "flashed", meaning that they will be
* automatically removed from the stack a fixed period of time
* after they are pushed.
*
* "Flashed" warnings and errors will persist longer than normal
* messages.
*
* There is no simple "pop" operation provided, since these
* stacks are intended to be shared by many different clients;
* assuming that the message you pushed is still on top is an
* invalid and unsafe assumption.
*/
{
MessageStack();
~MessageStack();
/** @brief returns the type of message currently at the top of the stack */
}
/** @brief returns the text of the message currently at the top of
* the stack
*/
gchar const *currentMessage() {
}
/** @brief connects to the "changed" signal which is emitted whenever
* the topmost message on the stack changes.
*/
{
}
/** @brief pushes a message onto the stack
*
* @param type the message type
* @param message the message text
*
* @return the id of the pushed message
*/
/** @brief pushes a message onto the stack using printf-like formatting
*
* @param type the message type
* @param format a printf-style format string
*
* @return the id of the pushed message
*/
/** @brief pushes a message onto the stack using printf-like formatting,
* using a stdarg argument list
*
* @param type the message type
* @param format a printf-style format string
* @param args the subsequent printf-style arguments
*
* @return the id of the pushed message
*/
/** @brief removes a message from the stack, given its id
*
* This method will remove a message from the stack if it has not
* already been removed. It may be removed from any part of the stack.
*
* @param id the message id to remove
*/
/** @brief temporarily pushes a message onto the stack
*
* @param type the message type
* @param message the message text
*
* @return the id of the pushed message
*/
/** @brief temporarily pushes a message onto the stack using
* printf-like formatting
*
* @param type the message type
* @param format a printf-style format string
*
* @return the id of the pushed message
*/
/** @brief temporarily pushes a message onto the stack using
* printf-like formatting, using a stdarg argument list
*
* @param type the message type
* @param format a printf-style format string
* @param args the printf-style arguments
*
* @return the id of the pushed message
*/
struct Message {
};
/// pushes a message onto the stack with an optional timeout
Message *_discard(Message *m); ///< frees a message struct and returns the next such struct in the list
void _emitChanged(); ///< emits the "changed" signal
};
}
#endif
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :