25#include <tqvaluelist.h>
29#include <koffice_export.h>
31#include "kspread_global.h"
32#include "kspread_util.h"
63 Region( const TQPoint& point, Sheet* sheet = 0);
71 Region( const TQRect& range, Sheet* sheet = 0);
80 Region( View* view, const TQString& strRegion, Sheet* sheet = 0);
96 Region( int col, int row, Sheet* sheet = 0);
107 Region( int col, int row, int width, int height, Sheet* sheet = 0);
120 TQString name(Sheet* originSheet = 0) const;
127 Sheet* filterSheetName(TQString& sRegion);
134 bool isEmpty() const;
139 bool isSingular() const;
144 bool isContiguous() const;
149 bool isValid() const;
156 bool isColumnSelected(uint col = 0) const;
163 bool isRowSelected(uint row = 0) const;
168 bool isColumnOrRowSelected() const;
174 bool isColumnAffected(uint col) const;
180 bool isRowAffected(uint row) const;
187 bool contains( const TQPoint& point, Sheet* sheet = 0) const;
197 Element* add( const TQPoint& point, Sheet* sheet = 0);
203 Element* add( const TQRect& range, Sheet* sheet = 0);
215 void sub( const TQPoint& point);
220 void sub( const TQRect& range);
225 void sub( const Region& region);
231 virtual Element* eor( const TQPoint& point, Sheet* sheet = 0);
236 virtual void clear();
240 TQRect boundingRect() const;
248 bool operator==( const Region& region) const;
253 void operator=( const Region& region);
268 typedef TQValueList<Element*>::Iterator Iterator;
269 typedef TQValueList<Element*>::ConstIterator ConstIterator;
271 ConstIterator constBegin() const;
272 ConstIterator constEnd() const;
278 TQValueList<Element*>& cells() const;
288 Iterator insert(Iterator iterator, const TQPoint& point, Sheet*, bool multi = true);
297 Iterator insert(Iterator iterator, const TQRect& range, Sheet*, bool multi = true);
299 virtual Point* createPoint( const TQPoint&) const;
300 virtual Point* createPoint( const TQString&) const;
301 virtual Point* createPoint( const Point&) const;
302 virtual Range* createRange( const TQRect&) const;
303 virtual Range* createRange( const TQString&) const;
304 virtual Range* createRange( const Range&) const;
332 virtual Type type() const { return Undefined; }
333 virtual bool isValid() const { return false; }
334 virtual bool isColumn() const { return false; }
335 virtual bool isRow() const { return false; }
337 virtual bool contains( const TQPoint&) const { return false; }
338 virtual bool contains( const TQRect&) const { return false; }
340 virtual TQString name(Sheet* = 0) const { return TQString( ""); }
341 virtual TQRect rect() const { return TQRect(); }
342 virtual const TQColor& color() const { return TQt::black; }
344 Sheet* sheet() const { return m_sheet; }
345 void setSheet(Sheet* sheet) { m_sheet = sheet; }
373 Point( const TQPoint&);
374 Point( const TQString&);
377 virtual Type type() const { return Element::Point; }
378 virtual bool isValid() const { return (!m_point.isNull() && util_isPointValid(pos())); }
379 virtual bool isColumn() const { return false; }
380 virtual bool isRow() const { return false; }
382 virtual bool contains( const TQPoint&) const;
383 virtual bool contains( const TQRect&) const;
385 virtual TQString name(Sheet* originSheet = 0) const;
387 virtual TQRect rect() const { return TQRect(m_point,m_point); }
389 TQPoint pos() const { return m_point; }
413 Range( const TQRect&);
414 Range( const TQString&);
417 virtual Type type() const { return Element::Range; }
418 virtual bool isValid() const { return !m_range.isNull() && util_isRectValid(rect()); }
419 virtual bool isColumn() const { return (m_range.normalize().top() == 1 && m_range.normalize().bottom() == KS_rowMax); }
420 virtual bool isRow() const { return (m_range.normalize().left() == 1 && m_range.normalize().right() == KS_colMax); }
422 virtual bool contains( const TQPoint&) const;
423 virtual bool contains( const TQRect&) const;
425 virtual TQString name(Sheet* originSheet = 0) const;
427 virtual TQRect rect() const { return m_range; }
443inline kdbgstream operator<<( kdbgstream str, const KSpread::Region& r )
445 str << "Region = " << r. name();
Base class for region elements, which can be points or ranges.
The one for all class for points and ranges.
TQString name(Sheet *originSheet=0) const
The View class displays a KSpread document.
|