export.h revision 3deb9b5ce0f058530cd0749009464b5afe8cf09c
/** @file
* @brief export to bitmap dialog
*/
/* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* bulia byak <buliabyak@users.sf.net>
* Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
*
* Copyright (C) 1999-2007 Authors
* Copyright (C) 2001-2002 Ximian, Inc.
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifndef SP_EXPORT_H
#define SP_EXPORT_H
#include <gtkmm/expander.h>
#include <gtkmm/textview.h>
#include <gtkmm/comboboxtext.h>
#include "desktop.h"
#include "ui/dialog/desktop-tracker.h"
#include "widgets/sp-attribute-widget.h"
/** What type of button is being pressed */
enum selection_type {
SELECTION_PAGE = 0, /**< Export the whole page */
SELECTION_DRAWING, /**< Export everything drawn on the page */
SELECTION_SELECTION, /**< Export everything that is selected */
SELECTION_CUSTOM, /**< Allows the user to set the region exported */
SELECTION_NUMBER_OF /**< A counter for the number of these guys */
};
/** A list of strings that is used both in the preferences, and in the
data fields to describe the various values of \c selection_type. */
static const char * selection_names[SELECTION_NUMBER_OF] = {
"page", "drawing", "selection", "custom"};
/** The names on the buttons for the various selection types. */
static const char * selection_labels[SELECTION_NUMBER_OF] = {
/**
* A dialog widget to export to various image formats such as bitmap and png.
*
* Creates a dialog window for exporting an image to a bitmap if one doesn't already exist and
* shows it to the user. If the dialog has already been created, it simply shows the window.
*
*/
Export ();
~Export ();
/**
* A function to set the xdpi.
*
* This function grabs all of the x values and then figures out the
* new bitmap size based on the changing dpi value. The dpi value is
* gotten from the xdpi setting as these can not currently be independent.
*
*/
void setImageX();
/**
* A function to set the ydpi.
*
* This function grabs all of the y values and then figures out the
* new bitmap size based on the changing dpi value. The dpi value is
* gotten from the xdpi setting as these can not currently be independent.
*/
void setImageY();
void updateCheckbuttons ();
inline void findDefaultSelection();
void detectSize();
/*
*/
#if WITH_GTKMM_3_0
#else
#endif
/**
* Helper function to create, style and pack spinbuttons for the export dialog.
*
* Creates a new spin button for the export dialog.
* @param key The name of the spin button
* @param val A default value for the spin button
* @param min Minimum value for the spin button
* @param max Maximum value for the spin button
* @param step The step size for the spin button
* @param page Size of the page increment
* @param us Unit selector that effects this spin button
* @param t Table to put the spin button in
* @param x X location in the table \c t to start with
* @param y Y location in the table \c t to start with
* @param ll Text to put on the left side of the spin button (optional)
* @param lr Text to put on the right side of the spin button (optional)
* @param digits Number of digits to display after the decimal
* @param sensitive Whether the spin button is sensitive or not
* @param cb Callback for when this spin button is changed (optional)
*/
#if WITH_GTKMM_3_0
#else
#endif
/**
* One of the area select radio buttons was pressed
*/
void onAreaToggled();
/**
* Export button callback
*/
void onExport ();
/**
* File Browse button callback
*/
void onBrowse ();
/**
* Area X value changed callback
*/
#if WITH_GTKMM_3_0
#else
#endif
/**
* Area Y value changed callback
*/
#if WITH_GTKMM_3_0
#else
#endif
/**
* Area width value changed callback
*/
void onAreaWidthChange ();
/**
* Area height value changed callback
*/
void onAreaHeightChange ();
/**
* Bitmap width value changed callback
*/
void onBitmapWidthChange ();
/**
* Bitmap height value changed callback
*/
void onBitmapHeightChange ();
/**
* Export xdpi value changed callback
*/
void onExportXdpiChange ();
/**
* Batch export callback
*/
void onBatchClicked ();
/**
* Inkscape selection change callback
*/
void onSelectionChanged ();
/**
* Filename modified callback
*/
void onFilenameModified ();
/**
* Can be invoked for setting the desktop. Currently not used.
*/
/**
* Is invoked by the desktop tracker when the desktop changes.
*/
/**
* Creates progress dialog for batch exporting.
*
* @param progress_text Text to be shown in the progress bar
*/
/**
* Callback to be used in for loop to update the progress bar.
*
* @param value number between 0 and 1 indicating the fraction of progress (0.17 = 17 % progress)
* @param dlg void pointer to the Gtk::Dialog progress dialog
*/
/**
* Callback for pressing the cancel button.
*/
void onProgressCancel ();
/**
* Callback invoked on closing the progress dialog.
*/
/*
* Utility filename and path functions
*/
void set_default_filename ();
Glib::ustring absolutize_path_from_document_location (SPDocument *doc, const Glib::ustring &filename);
/*
* Currently selected export area type
*/
/*
* Original name for the export object
*/
/*
* Was the Original name modified
*/
bool filename_modified;
bool was_empty;
/*
* Flag to stop simultaneous updates
*/
bool update;
/* Area selection radio buttons */
#if WITH_GTKMM_3_0
/* Custom size widgets */
/* Bitmap size widgets */
#else
/* Custom size widgets */
/* Bitmap size widgets */
#endif
/* Unit selector widgets */
/* Filename widgets */
/* Export Button widgets */
bool interrupted; // indicates whether export needs to be interrupted (read: user pressed cancel in the progress dialog)
};
}
}
}
#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:fileencoding=utf-8:textwidth=99 :