bool.h revision dfb3bedecacaed5e6c8e1fe5da96c987d15cc9d6
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith#ifndef SEEN_INK_EXTENSION_PARAMBOOL_H
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith#define SEEN_INK_EXTENSION_PARAMBOOL_H
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith/*
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith * Copyright (C) 2005-2007 Authors:
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith * Ted Gould <ted@gould.cx>
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith * Johan Engelen <johan@shouraizou.nl> *
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith * Jon A. Cruz <jon@joncruz.org>
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith * Released under GNU GPL, read the file 'COPYING' for more information
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith */
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith#include <gtkmm/widget.h>
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith#include <xml/node.h>
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith#include <document.h>
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith#include "parameter.h"
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smithnamespace Inkscape {
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smithnamespace Extension {
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith/**
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith * A boolean parameter.
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith */
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smithclass ParamBool : public Parameter {
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smithpublic:
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith /**
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith * Use the superclass' allocator and set the \c _value.
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith */
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith ParamBool(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml);
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith /**
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith * Returns the current state/value.
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith */
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith bool get(const SPDocument * doc, const Inkscape::XML::Node * node) const;
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith /**
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith * A function to set the state/value.
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith * This function sets the internal value, but it also sets the value
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith * in the preferences structure. To put it in the right place, \c PREF_DIR
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith * and \c pref_name() are used.
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith *
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith * @param in The value to set to
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith * @param doc A document that should be used to set the value.
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith * @param node The node where the value may be placed
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith */
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith bool set(bool in, SPDocument * doc, Inkscape::XML::Node * node);
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith /**
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith * Creates a bool check button for a bool parameter.
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith * Builds a hbox with a label and a check button in it.
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith */
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith Gtk::Widget *get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal<void> * changeSignal);
20e25114cc4b04c88faf68f0f3e19dc13833474aAlex Valavanis
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith /**
20e25114cc4b04c88faf68f0f3e19dc13833474aAlex Valavanis * Appends 'true' or 'false'.
20e25114cc4b04c88faf68f0f3e19dc13833474aAlex Valavanis * @todo investigate. Returning a value that can then be appended would probably work better/safer.
20e25114cc4b04c88faf68f0f3e19dc13833474aAlex Valavanis */
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith void string(std::string &string) const;
20e25114cc4b04c88faf68f0f3e19dc13833474aAlex Valavanis
20e25114cc4b04c88faf68f0f3e19dc13833474aAlex Valavanisprivate:
20e25114cc4b04c88faf68f0f3e19dc13833474aAlex Valavanis /** Internal value. */
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith bool _value;
20e25114cc4b04c88faf68f0f3e19dc13833474aAlex Valavanis int _indent;
20e25114cc4b04c88faf68f0f3e19dc13833474aAlex Valavanis};
20e25114cc4b04c88faf68f0f3e19dc13833474aAlex Valavanis
20e25114cc4b04c88faf68f0f3e19dc13833474aAlex Valavanis} // namespace Extension
20e25114cc4b04c88faf68f0f3e19dc13833474aAlex Valavanis} // namespace Inkscape
20e25114cc4b04c88faf68f0f3e19dc13833474aAlex Valavanis
20e25114cc4b04c88faf68f0f3e19dc13833474aAlex Valavanis#endif // SEEN_INK_EXTENSION_PARAMBOOL_H
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith
20e25114cc4b04c88faf68f0f3e19dc13833474aAlex Valavanis/*
20e25114cc4b04c88faf68f0f3e19dc13833474aAlex Valavanis Local Variables:
20e25114cc4b04c88faf68f0f3e19dc13833474aAlex Valavanis mode:c++
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith c-file-style:"stroustrup"
20e25114cc4b04c88faf68f0f3e19dc13833474aAlex Valavanis c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
20e25114cc4b04c88faf68f0f3e19dc13833474aAlex Valavanis indent-tabs-mode:nil
20e25114cc4b04c88faf68f0f3e19dc13833474aAlex Valavanis fill-column:99
20e25114cc4b04c88faf68f0f3e19dc13833474aAlex Valavanis End:
20e25114cc4b04c88faf68f0f3e19dc13833474aAlex Valavanis*/
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
6bd7ac3b4704cf1cba90dd21a73bfedd6d640a16John Smith