Scribus
Open source desktop publishing at your fingertips
Selection Class Reference
Inheritance diagram for Selection:
Collaboration diagram for Selection:

Signals

void selectionIsMultiple (bool)
 
void empty ()
 
void selectionChanged ()
 

Public Member Functions

 Selection (QObject *parent)
 Create an empty selection that is not a GUI selection. More...
 
 Selection (QObject *parent, bool guiSelection)
 Create an empty selection that may be a GUI selection. More...
 
 Selection (const Selection &other)
 Copy a selection. More...
 
Selectionoperator= (const Selection &)
 
void copy (Selection &other, bool emptyOther)
 Copy the selection of items from one selection to another.
 
bool connectItemToGUI ()
 
bool disconnectAllItemsFromGUI ()
 Disconnect all items from the GUI slots. This should not really be necessary if all things are going ok except for within the clearAll function. More...
 
bool addItem (PageItem *item, bool ignoreGUI=false)
 Add an item to the selection. If its added to a GUI selection selection and its item 0, its connected to the GUI too. More...
 
bool prependItem (PageItem *item, bool doEmit=true)
 Prepend an item to the selection. If its added to a GUI selection selection and its item 0, its connected to the GUI too. More...
 
bool containsItem (PageItem *item) const
 
bool addGroup ()
 Unused.
 
bool removeItem (PageItem *item)
 Remove an item from list. More...
 
bool removeFirst ()
 Remove the first item from the list. More...
 
bool removeGroup ()
 Unused.
 
PageItemtakeItem (int itemIndex)
 Remove an item from list listNumber and return a pointer to it. More...
 
int findItem (PageItem *item) const
 Find an item from the selection and return an index to it. More...
 
int count () const
 Return the count of the selection.
 
bool isEmpty () const
 Check if the selection is empty.
 
bool clear ()
 Clear a list.
 
bool primarySelectionIs (const PageItem *item) const
 See if the first selected item is "me", usually called from an item object with "this". More...
 
const SelectionList & selectionList () const
 
PageItemitemAt (int index=0)
 
const PageItemitemAt (int index=0) const
 
QList< PageItem * > items () const
 
QStringList getSelectedItemsByName () const
 
bool isMultipleSelection () const
 
bool isGUISelection () const
 
double width () const
 
double height () const
 
void setGroupRect ()
 
void getGroupRect (double *x, double *y, double *w, double *h)
 
QRectF getGroupRect ()
 
void getVisualGroupRect (double *x, double *y, double *w, double *h)
 
QRectF getVisualGroupRect ()
 
bool itemsAreSameType () const
 Test to see if all items in the selection are the same typedef.
 
int objectsLayer (void) const
 get the layer ID of items in the selection More...
 
bool objectsHaveSameParent (void) const
 detect if selected object have all same parent (doc or group) More...
 
bool signalsDelayed (void)
 
void delaySignalsOn (void)
 
void delaySignalsOff (void)
 

Protected Member Functions

PageItemitemAt_ (int index=0)
 
void sendSignals (bool guiConnect=true)
 

Protected Attributes

SelectionList m_SelList
 
bool m_isGUISelection
 
double groupX
 
double groupY
 
double groupW
 
double groupH
 
double visualGX
 
double visualGY
 
double visualGW
 
double visualGH
 
int m_delaySignals
 
bool m_sigSelectionChanged
 
bool m_sigSelectionIsMultiple
 

Constructor & Destructor Documentation

Selection::Selection ( QObject *  parent)
explicit

Create an empty selection that is not a GUI selection.

Parameters
parentQObject
Selection::Selection ( QObject *  parent,
bool  guiSelection 
)

Create an empty selection that may be a GUI selection.

Parameters
parentQObject
guiSelectionIf the selection is to be a GUI selection
Selection::Selection ( const Selection other)

Copy a selection.

Note
We are leaving the connections of the items in place and the isGUISelection set in the copy. We cannot disconnect them as they may be connected via the main GUI selection.
Parameters
otherselection

Member Function Documentation

bool Selection::addItem ( PageItem item,
bool  ignoreGUI = false 
)

Add an item to the selection. If its added to a GUI selection selection and its item 0, its connected to the GUI too.

Parameters
itemItem to add
ignoreGUIDont connect Item To GUI even if this is a GUI selection
Returns
If the item was added
bool Selection::disconnectAllItemsFromGUI ( )

Disconnect all items from the GUI slots. This should not really be necessary if all things are going ok except for within the clearAll function.

Returns
bool true on success
int Selection::findItem ( PageItem item) const
inline

Find an item from the selection and return an index to it.

Parameters
itemItem pointer to find in the list
Returns
Item
bool Selection::objectsHaveSameParent ( void  ) const

detect if selected object have all same parent (doc or group)

Returns
true if objects share same parent, false otherwise
int Selection::objectsLayer ( void  ) const

get the layer ID of items in the selection

Returns
the layer ID or -1 if items do not belong to the same layer
bool Selection::prependItem ( PageItem item,
bool  doEmit = true 
)

Prepend an item to the selection. If its added to a GUI selection selection and its item 0, its connected to the GUI too.

Parameters
itemItem to add
doEmitcall emitAllToGUI()
Returns
If the item was added
bool Selection::primarySelectionIs ( const PageItem item) const
inline

See if the first selected item is "me", usually called from an item object with "this".

Parameters
itemPageItem reference
bool Selection::removeFirst ( )

Remove the first item from the list.

Returns
If the remove was successful
bool Selection::removeItem ( PageItem item)

Remove an item from list.

Parameters
itempage item
PageItem * Selection::takeItem ( int  itemIndex)

Remove an item from list listNumber and return a pointer to it.

Parameters
itemIndexIndex of the item in the list
Returns
Item

The documentation for this class was generated from the following files: