selection.h revision 364d9045bfd158352b8040721b3e2e2602e921ea
#ifndef SEEN_INKSCAPE_SELECTION_H
#define SEEN_INKSCAPE_SELECTION_H
/** \file
* Inkscape::Selection: per-desktop selection container
*
* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* MenTaLguY <mental@rydia.net>
* bulia byak <buliabyak@users.sf.net>
*
* Copyright (C) 2004-2005 MenTaLguY
* Copyright (C) 1999-2002 Lauris Kaplinski
* Copyright (C) 2001-2002 Ximian, Inc.
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <vector>
#include <map>
#include <list>
#include <stddef.h>
#include "libnr/nr-convex-hull.h"
#include "forward.h"
#include "gc-managed.h"
#include "gc-finalized.h"
#include "gc-anchored.h"
#include "gc-soft-ptr.h"
#include "sp-item.h"
#include "snapped-point.h"
}
}
/**
* @brief The set of selected SPObjects for a given desktop.
*
* This class represents the set of selected SPItems for a given
* SPDesktop.
*
* An SPObject and its parent cannot be simultaneously selected;
* selecting an SPObjects has the side-effect of unselecting any of
* its children which might have been selected.
*
* This is a per-desktop object that keeps the list of selected objects
* at the given desktop. Both SPItem and SPRepr lists can be retrieved
* from the selection. Many actions operate on the selection, so it is
* widely used throughout the code.
* It also implements its own asynchronous notification signals that
* UI elements can listen to.
*/
{
/**
* Constructs an selection object, bound to a particular
* SPDesktop
*
* @param desktop the desktop in question
*/
~Selection();
/**
* @brief Returns the desktop the selection is bound to
*
* @return the desktop the selection is bound to
*/
/**
* @brief Returns active layer for selection (currentLayer or its parent)
*
* @return layer item the selection is bound to
*/
/**
* @brief Add an SPObject to the set of selected objects
*
* @param obj the SPObject to add
*/
/**
* @brief Add an XML node's SPObject to the set of selected objects
*
* @param the xml node of the item to add
*/
/**
* @brief Set the selection to a single specific object
*
* @param obj the object to select
*/
/**
* @brief Set the selection to an XML node's SPObject
*
* @param repr the xml node of the item to select
*/
/**
* @brief Removes an item from the set of selected objects
*
* It is ok to call this method for an unselected item.
*
* @param item the item to unselect
*/
/**
* @brief Removes an item if selected, adds otherwise
*
* @param item the item to unselect
*/
/**
* @brief Removes an item from the set of selected objects
*
* It is ok to call this method for an unselected item.
*
* @param repr the xml node of the item to remove
*/
/**
* @brief Selects exactly the specified objects
*
* @param objs the objects to select
*/
/**
* @brief Adds the specified objects to selection, without deselecting first
*
* @param objs the objects to select
*/
/**
* @brief Clears the selection and selects the specified objects
*
* @param repr a list of xml nodes for the items to select
*/
/** \brief Add items from an STL iterator range to the selection
* \param from the begin iterator
* \param to the end iterator
*/
++from;
}
_emitChanged();
}
/**
* @brief Unselects all selected objects.
*/
void clear();
/**
* @brief Returns true if no items are selected
*/
/**
* @brief Returns true if the given object is selected
*/
/**
* @brief Returns true if the given item is selected
*/
}
/**
* @brief Returns a single selected object
*
* @return NULL unless exactly one object is selected
*/
/**
* @brief Returns a single selected item
*
* @return NULL unless exactly one object is selected
*/
SPItem *singleItem();
/**
* @brief Returns a single selected object's xml node
*
* @return NULL unless exactly one object is selected
*/
/** @brief Returns the list of selected objects */
/** @brief Returns the list of selected SPItems */
/** @brief Returns a list of the xml nodes of all selected objects */
/// \todo only returns reprs of SPItems currently; need a separate
/// method for that
/** @brief Returns a list of all perspectives which have a 3D box in the current selection
(these may also be nested in groups) */
/** @brief Returns a list of all 3D boxes in the current selection which are associated to @c
persp. If @c pers is @c NULL, return all selected boxes.
*/
/** @brief Returns the number of layers in which there are selected objects */
/** @brief Returns the number of parents to which the selected objects belong */
/** @brief Returns the bounding rectangle of the selection */
/** @brief Returns the bounding rectangle of the selection */
/**
* @brief Returns the bounding rectangle of the selection
*
* Gives the coordinates in internal format, does not match onscreen guides.
* (0,0 is the upper left corner, not the lower left corner)
*/
/**
* @brief Returns the bounding rectangle of the selection
*
* Gives the coordinates in internal format, does not match onscreen guides.
* (0,0 is the upper left corner, not the lower left corner)
*/
/**
*/
/**
* @brief Gets the selection's snap points.
* @return Selection's snap points
*/
/**
* @brief Gets the snap points of a selection that form a convex hull.
* @return Selection's convex hull points
*/
std::vector<Inkscape::SnapCandidatePoint> getSnapPointsConvexHull(SnapPreferences const *snapprefs) const;
/**
* @brief Connects a slot to be notified of selection changes
*
* This method connects the given slot such that it will
* be called upon any change in the set of selected objects.
*
* @param slot the slot to connect
*
* @return the resulting connection
*/
}
/**
* @brief Connects a slot to be notified of selected
* object modifications
*
* This method connects the given slot such that it will
* receive notifications whenever any selected item is
* modified.
*
* @param slot the slot to connect
*
* @return the resulting connection
*
*/
{
}
/** @brief no copy */
/** @brief no assign */
/** @brief Issues modification notification signals */
/** @brief Schedules an item modification signal to be sent */
/** @brief Issues modified selection signal */
/** @brief Issues changed selection signal */
void _emitChanged(bool persist_selection_context = false);
void _invalidateCachedLists();
/** @brief unselect all descendants of the given item */
/** @brief unselect all ancestors of the given item */
/** @brief clears the selection (without issuing a notification) */
void _clear();
/** @brief adds an object (without issuing a notification) */
/** @brief removes an object (without issuing a notification) */
/** @brief returns the SPObject corresponding to an xml node (if any) */
/** @brief Releases an active layer object that is being removed */
};
}
#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 :