kspread Library API Documentation

kspread_selection.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017    Boston, MA 02111-1307, USA.
00018 */
00019 
00020 #ifndef __kspread_selection_h__
00021 #define __kspread_selection_h__
00022 
00023 #include <qrect.h>
00024 #include "kspread_util.h"
00025 
00026 class KSpreadSheet;
00027 class KSpreadView;
00028 
00029 class KSPREAD_EXPORT KSpreadSelection
00030 {
00031 public:
00032 
00033   KSpreadSelection(KSpreadView* view);
00034 
00035   virtual ~KSpreadSelection();
00036 
00040 //  void unselect();
00041 
00042 
00048   QPoint marker() const;
00049 
00055   QRect selection(bool extend = true) const;
00056 
00060   bool singleCellSelection() const;
00061 
00065   QRect selectionHandleArea() const;
00066 
00067   void setSelection( const QPoint &marker, const QPoint &anchor,
00068                      KSpreadSheet* sheet );
00069 
00070   void setMarker( const QPoint &point, KSpreadSheet* sheet );
00071 
00075    QPoint selectionAnchor()const;
00076 
00090   bool setCursorPosition(const QPoint &position);
00091 
00097   QPoint cursorPosition() const;
00098 
00099 
00100   void setChooseAnchor( const QPoint &chooseAnchor )
00101     { m_chooseAnchor = chooseAnchor; }
00102   void setChooseMarker( const QPoint &chooseMarker )
00103     { m_chooseMarker = chooseMarker; }
00104   void setChooseCursor( KSpreadSheet* sheet, const QPoint &chooseCursor )
00105     { m_chooseSheet = sheet; m_chooseCursor = chooseCursor; }
00106   void setChooseSheet(KSpreadSheet* sheet) { m_chooseSheet = sheet; }
00107 
00108   QRect getChooseRect()const;
00109   QPoint getChooseCursor()const { return m_chooseCursor; }
00110   QPoint getChooseMarker()const { return m_chooseMarker; }
00111   QPoint getChooseAnchor()const { return m_chooseAnchor; }
00112 
00113   KSpreadSheet* getChooseSheet()const { return m_chooseSheet; }
00114 
00115 
00116 private: /* private data for the above functions on selections */
00124 //  QRect m_rctSelection;
00125   QPoint m_marker;
00126   QPoint m_cursorPosition;
00127   QPoint m_anchor;
00128 
00129   QPoint m_chooseMarker;
00130   QPoint m_chooseAnchor;
00131   QPoint m_chooseCursor;
00132 
00133   KSpreadSheet* m_chooseSheet;
00134   KSpreadView* m_pView;
00135 
00136 private:
00137   /* helper functions */
00138   QRect extendToMergedAreas(QRect area) const;
00139 
00140 };
00141 
00142 
00143 #endif
KDE Logo
This file is part of the documentation for kspread Library Version 1.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Feb 13 09:43:13 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003