find.h revision b411bf4b8d2be4d10c0c5371c3b282639ff47bcf
/** @file
* @brief Find dialog
*/
/* Authors:
* Bryce W. Harrington <bryce@bryceharrington.org>
*
* Copyright (C) 2004, 2005 Authors
*
* Released under GNU GPL. Read the file 'COPYING' for more information.
*/
#ifndef INKSCAPE_UI_DIALOG_FIND_H
#define INKSCAPE_UI_DIALOG_FIND_H
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <glib.h>
#include <gtkmm.h>
#include "desktop.h"
#include "ui/dialog/desktop-tracker.h"
/**
* The Find class defines the Find and replace dialog.
*
* The Find and replace dialog allows you to search within the
* current document for specific text or properties of items.
* Matches items are highlighted and can be replaced as well.
* Scope can be limited to the entire document, current layer or selected items.
* Other options allow searching on specific object types and properties.
*/
Find();
/**
* Helper function which returns a new instance of the dialog.
* getInstance is needed by the dialog manager (Inkscape::UI::Dialog::DialogManager).
*/
/**
* Callbacks for pressing the dialog buttons.
*/
void onFind();
void onReplace();
void onExpander();
void onAction();
void onToggleAlltypes();
void onToggleCheck();
void onSearchinText();
void onSearchinProperty();
/**
* Toggle all the properties checkboxes
*/
void searchinToggle(bool on);
/**
* Returns true if the SPItem 'item' has the same id
*
* @param item the SPItem to check
* @param id the value to compare with
* @param exact do an exacty match
* @param casematch match the text case exactly
* @param replace replace the value if found
*
*/
/**
* Returns true if the SPItem 'item' has the same text content
*
* @param item the SPItem to check
* @param name the value to compare with
* @param exact do an exacty match
* @param casematch match the text case exactly
* @param replace replace the value if found
*
*
*/
bool item_text_match (SPItem *item, const gchar *text, bool exact, bool casematch, bool replace=false);
/**
* Returns true if the SPItem 'item' has the same text in the style attribute
*
* @param item the SPItem to check
* @param name the value to compare with
* @param exact do an exacty match
* @param casematch match the text case exactly
* @param replace replace the value if found
*
*/
bool item_style_match (SPItem *item, const gchar *text, bool exact, bool casematch, bool replace=false);
/**
* Returns true if found the SPItem 'item' has the same attribute name
*
* @param item the SPItem to check
* @param name the value to compare with
* @param exact do an exacty match
* @param casematch match the text case exactly
* @param replace replace the value if found
*
*/
bool item_attr_match (SPItem *item, const gchar *name, bool exact, bool casematch, bool replace=false);
/**
* Returns true if the SPItem 'item' has the same attribute value
*
* @param item the SPItem to check
* @param name the value to compare with
* @param exact do an exacty match
* @param casematch match the text case exactly
* @param replace replace the value if found
*
*/
bool item_attrvalue_match (SPItem *item, const gchar *name, bool exact, bool casematch, bool replace=false);
/**
* Returns true if the SPItem 'item' has the same font values
*
* @param item the SPItem to check
* @param name the value to compare with
* @param exact do an exacty match
* @param casematch match the text case exactly
* @param replace replace the value if found
*
*/
bool item_font_match (SPItem *item, const gchar *name, bool exact, bool casematch, bool replace=false);
/**
* Function to filter a list of items based on the item type by calling each item_XXX_match function
*/
/**
* Find a string within a string and returns true if found with options for exact and casematching
*/
/**
* Find a string within a string and return the position with options for exact, casematching and search start location
*/
gsize find_strcmp_pos(const gchar *str, const gchar *find, bool exact, bool casematch, gsize start=0);
/**
*/
Glib::ustring find_replace(const gchar *str, const gchar *find, const gchar *replace, bool exact, bool casematch, bool replaceall);
/**
* recursive function to return a list of all the items in the SPObject tree
*
*/
/**
* to return a list of all the selected items
*
*/
GSList * all_selection_items (Inkscape::Selection *s, GSList *l, SPObject *ancestor, bool hidden, bool locked);
/**
* Shrink the dialog size when the expander widget is closed
* Currently not working, no known way to do this
*/
void squeeze_window();
/**
* Can be invoked for setting the desktop. Currently not used.
*/
/**
* Is invoked by the desktop tracker when the desktop changes.
*/
/**
* Called when desktop selection changes
*/
void onSelectionChange(void);
/*
* Find and replace combo box widgets
*/
/**
* Scope and search in widgets
*/
/**
* General option widgets
*/
/**
* Property type widgets
*/
/**
* A vector of all the properties widgets for easy processing
*/
/**
* Object type widgets
*/
/**
* A vector of all the check option widgets for easy processing
*/
//Gtk::HBox hbox_text;
/**
* Action Buttons and status
*/
#if WITH_GTKMM_3_0
#else
#endif
/**
* Finding or replacing
*/
bool _action_replace;
bool blocked;
};
} // namespace Dialog
} // namespace UI
} // namespace Inkscape
#endif // INKSCAPE_UI_DIALOG_FIND_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:fileencoding=utf-8:textwidth=99 :