filedialogimpl-gtkmm.h revision 4325c73c705ad4c09590f8d4f1e62d849eeda096
/** @file
* @brief Implementation of the file dialog interfaces defined in filedialogimpl.h
*/
/* Authors:
* Bob Jamison
* Johan Engelen <johan@shouraizou.nl>
* Joel Holdsworth
* Bruno Dilly
* Other dudes from The Inkscape Organization
*
* Copyright (C) 2004-2008 Authors
* Copyright (C) 2004-2007 The Inkscape Organization
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifndef __FILE_DIALOGIMPL_H__
#define __FILE_DIALOGIMPL_H__
#include "filedialog.h"
//General includes
#include <unistd.h>
#include <errno.h>
//Gtk includes
//Temporary ugly hack
//Remove this after the get_filter() calls in
//show() on both classes are fixed
#include <gtk/gtkfilechooser.h>
//Another hack
#include <gtk/gtkentry.h>
#include <gtk/gtkexpander.h>
//Inkscape includes
#include "inkscape.h"
#include "svg-view-widget.h"
//For export dialog
#include "ui/widget/scalar-unit.h"
{
{
{
/*#########################################################################
### Utility
#########################################################################*/
void
void
void
/*#########################################################################
### SVG Preview Widget
#########################################################################*/
{
FileType() {}
~FileType() {}
};
/**
* Simple class for displaying an SVG file in the "preview widget."
* Currently, this is just a wrapper of the sp_svg_view Gtk widget.
* Hopefully we will eventually replace with a pure Gtkmm widget.
*/
{
SVGPreview();
~SVGPreview();
bool setFromMem(char const *xmlBuffer);
/**
* Show image embedded in SVG
*/
/**
* Show the "No preview" image
*/
void showNoPreview();
/**
* Show the "Too large" image
*/
void showTooLarge(long fileLength);
/**
* The svg document we are currently showing
*/
/**
* The sp_svg_view widget
*/
/**
* are we currently showing the "no preview" image?
*/
bool showingNoPreview;
};
/*#########################################################################
### F I L E D I A L O G B A S E C L A S S
#########################################################################*/
/**
* This class is the base implementation for the others. This
* reduces redundancies and bugs.
*/
{
/**
*
*/
{
}
/**
*
*/
{
}
/**
*
*/
{}
void cleanup( bool showConfirmed );
/**
* What type of 'open' are we? (open, import, place, etc)
*/
/**
* Our svg preview widget
*/
/**
* Child widgets
*/
void internalSetup();
/**
* Callback for user changing preview checkbox
*/
void _previewEnabledCB();
/**
* Callback for seeing if the preview needs to be drawn
*/
void _updatePreviewCallback();
};
/*#########################################################################
### F I L E O P E N
#########################################################################*/
/**
* Our implementation class for the FileOpenDialog interface..
*/
{
bool show();
/**
* Create a filter menu for this type of dialog
*/
void createFilterMenu();
/**
* Filter name->extension lookup
*/
/**
* The extension to use to write this file
*/
};
//########################################################################
//# F I L E S A V E
//########################################################################
/**
* Our implementation of the FileSaveDialog interface.
*/
{
const bool save_copy);
bool show();
//void change_title(const Glib::ustring& title);
void updateNameAndExtension();
/**
* Whether the dialog was invoked by "Save as ..." or "Save a copy ..."
*/
bool is_copy;
/**
* Fix to allow the user to type the file name
*/
/**
* Allow the specification of the output file type
*/
/**
* Data mirror of the combo box
*/
//# Child widgets
/**
* Callback for user input into fileNameEntry
*/
void fileTypeChangedCallback();
/**
* Create a filter menu for this type of dialog
*/
void createFileTypeMenu();
/**
* The extension to use to write this file
*/
/**
* Callback for user input into fileNameEntry
*/
void fileNameEntryChangedCallback();
};
//########################################################################
//# F I L E E X P O R T
//########################################################################
/**
* Our implementation of the FileExportDialog interface.
*/
{
bool show();
/**
* Return the scope of the export. One of the enumerated types
* in ScopeType
*/
{
if (pageButton.get_active())
return SCOPE_PAGE;
else if (selectionButton.get_active())
return SCOPE_SELECTION;
else if (customButton.get_active())
return SCOPE_CUSTOM;
else
return SCOPE_DOCUMENT;
}
/**
* Return left side of the exported region
*/
double getSourceX()
{ return sourceX0Spinner.getValue(); }
/**
* Return the top of the exported region
*/
double getSourceY()
{ return sourceY1Spinner.getValue(); }
/**
* Return the width of the exported region
*/
double getSourceWidth()
{ return sourceWidthSpinner.getValue(); }
/**
* Return the height of the exported region
*/
double getSourceHeight()
{ return sourceHeightSpinner.getValue(); }
/**
* Return the units of the coordinates of exported region
*/
{ return sourceUnitsSpinner.getUnitAbbr(); }
/**
* Return the width of the destination document
*/
double getDestinationWidth()
{ return destWidthSpinner.getValue(); }
/**
* Return the height of the destination document
*/
double getDestinationHeight()
{ return destHeightSpinner.getValue(); }
/**
* Return the height of the exported region
*/
{ return destUnitsSpinner.getUnitAbbr(); }
/**
* Return the destination DPI image resulution, if bitmap
*/
double getDestinationDPI()
{ return destDPISpinner.getValue(); }
/**
* Return whether we should use Cairo for rendering
*/
bool getUseCairo()
{ return cairoButton.get_active(); }
/**
* Return whether we should use antialiasing
*/
bool getUseAntialias()
{ return antiAliasButton.get_active(); }
/**
* Return the background color for exporting
*/
unsigned long getBackground()
/**
* Fix to allow the user to type the file name
*/
//##########################################
//# EXTRA WIDGET -- SOURCE SIDE
//##########################################
//##########################################
//# EXTRA WIDGET -- DESTINATION SIDE
//##########################################
/**
* 'Extra' widget that holds two boxes above
*/
//# Child widgets
/**
* Allow the specification of the output file type
*/
/**
* Data mirror of the combo box
*/
/**
* Callback for user input into fileNameEntry
*/
void fileTypeChangedCallback();
/**
* Create a filter menu for this type of dialog
*/
void createFileTypeMenu();
bool append_extension;
/**
* The extension to use to write this file
*/
/**
* Callback for user input into fileNameEntry
*/
void fileNameEntryChangedCallback();
/**
* Filename that was given
*/
};
} // namespace Dialog
} // namespace UI
} // namespace Inkscape
#endif /*__FILE_DIALOGIMPL_H__*/
/*
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 :