30 #include "scribusapi.h"
32 typedef QList< QPointer<PageItem> > SelectionList;
48 Selection(QObject* parent,
bool guiSelection);
63 void copy(
Selection& other,
bool emptyOther);
65 bool connectItemToGUI();
72 bool disconnectAllItemsFromGUI();
80 bool addItem(
PageItem *item,
bool ignoreGUI=
false);
88 bool prependItem(
PageItem *item,
bool doEmit=
true);
90 bool containsItem(
PageItem *item)
const {
return m_SelList.contains(item); }
124 int count()
const {
return m_SelList.count(); }
128 bool isEmpty()
const {
return m_SelList.count()==0; }
138 const SelectionList& selectionList()
const {
return m_SelList;}
139 PageItem *itemAt(
int index=0) {
return itemAt_(index); }
140 const PageItem *itemAt(
int index=0)
const {
return const_cast<Selection*
>(
this)->itemAt_(index); }
141 QList<PageItem*> items()
const;
142 QStringList getSelectedItemsByName()
const;
143 bool isMultipleSelection()
const {
return (m_SelList.count() > 1); }
144 bool isGUISelection()
const {
return m_isGUISelection; }
145 double width()
const;
146 double height()
const;
149 void getGroupRect(
double *x,
double *y,
double *w,
double *h);
150 QRectF getGroupRect();
151 void getVisualGroupRect(
double *x,
double *y,
double *w,
double *h);
152 QRectF getVisualGroupRect();
154 bool itemsAreSameType()
const;
160 int objectsLayer(
void)
const;
166 bool objectsHaveSameParent(
void)
const;
168 bool signalsDelayed(
void);
169 void delaySignalsOn(
void);
170 void delaySignalsOff(
void);
174 SelectionList m_SelList;
175 bool m_isGUISelection;
187 bool m_sigSelectionChanged;
188 bool m_sigSelectionIsMultiple;
190 void sendSignals(
bool guiConnect =
true);
193 void selectionIsMultiple(
bool);
195 void selectionChanged();
int count() const
Return the count of the selection.
Definition: selection.h:124
int findItem(PageItem *item) const
Find an item from the selection and return an index to it.
Definition: selection.h:120
bool primarySelectionIs(const PageItem *item) const
See if the first selected item is "me", usually called from an item object with "this".
Definition: selection.h:137
bool isEmpty() const
Check if the selection is empty.
Definition: selection.h:128
Definition: pageitem.h:92
Definition: selection.h:34