• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

fv_Selection.h

Go to the documentation of this file.
00001 /* AbiWord
00002  * Copyright (c) 2003 Martin Sevior <msevior@physics.unimelb.edu.au>
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program 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
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017  * 02110-1301 USA.
00018  */
00019 
00020 #ifndef FV_SELECTION_H
00021 #define FV_SELECTION_H
00022 
00023 #include "pt_Types.h"
00024 #include "ut_vector.h"
00025 #include "ut_string_class.h"
00026 
00027 typedef enum _FV_SelectionMode
00028 {
00029     FV_SelectionMode_NONE,
00030     FV_SelectionMode_TOC,
00031     FV_SelectionMode_TableRow,
00032     FV_SelectionMode_Single,
00033     FV_SelectionMode_Multiple,
00034     FV_SelectionMode_TableColumn
00035 } FV_SelectionMode;
00036 
00037 class UT_ByteBuf;
00038 class FL_DocLayout;
00039 class PD_Document;
00040 class FV_View;
00041 class fl_TableLayout;
00042 class fl_CellLayout;
00043 class fl_TOCLayout;
00044 class ABI_EXPORT FV_Selection
00045 {
00046     friend class fv_View;
00047 
00048 public:
00049 class ABI_EXPORT FV_SelectionCellProps
00050 {
00051 public:
00052     FV_SelectionCellProps(void):m_iLeft(0),
00053                                 m_iRight(0),
00054                                 m_iTop(0),
00055                                 m_iBot(0),
00056                                 m_sProps("")
00057         {}
00058     UT_sint32 m_iLeft;
00059     UT_sint32 m_iRight;
00060     UT_sint32 m_iTop;
00061     UT_sint32 m_iBot;
00062     UT_String m_sProps;
00063 };
00064 
00065     FV_Selection(FV_View * pView);
00066     ~FV_Selection();
00067     PD_Document *         getDoc(void) const;
00068     FL_DocLayout *        getLayout(void) const;
00069     void                  setMode(FV_SelectionMode iSelMode);
00070     FV_SelectionMode      getSelectionMode(void) const
00071         { return m_iSelectionMode;}
00072     FV_SelectionMode      getPrevSelectionMode(void) const
00073         { return m_iPrevSelectionMode;}
00074     void                  setTOCSelected(fl_TOCLayout * pTOCL);
00075     fl_TOCLayout *        getSelectedTOC(void)
00076         { return m_pSelectedTOC;}
00077     PT_DocPosition        getSelectionAnchor(void) const;
00078     void                  setSelectionAnchor(PT_DocPosition pos);
00079     PT_DocPosition        getSelectionLeftAnchor(void) const;
00080     void                  setSelectionLeftAnchor(PT_DocPosition pos);
00081     PT_DocPosition        getSelectionRightAnchor(void) const;
00082     void                  setSelectionRightAnchor(PT_DocPosition pos);
00083     UT_sint32             getNumSelections(void) const;
00084     PD_DocumentRange *    getNthSelection(UT_sint32 i) const;
00085     void                  addSelectedRange(PT_DocPosition posLow, PT_DocPosition posHigh, bool bAddData);
00086     bool                  isPosSelected(PT_DocPosition pos) const;
00087     bool                  isSelected(void) const;
00088     void                  clearSelection(void);
00089     void                  setTableLayout(fl_TableLayout * pFL);
00090     fl_TableLayout *      getTableLayout(void) const;
00091     void                  addCellToSelection(fl_CellLayout * pCell);
00092     void                  pasteRowOrCol(void);
00093     void                  checkSelectAll(void);
00094     void                  setSelectAll(bool bSelectAll);
00095     bool                  isSelectAll(void) const
00096     { return m_bSelectAll;}
00097 private:
00098     FV_View *             m_pView;
00099     FV_SelectionMode      m_iSelectionMode;
00100     FV_SelectionMode      m_iPrevSelectionMode;
00101     PT_DocPosition        m_iSelectAnchor;
00102     PT_DocPosition        m_iSelectLeftAnchor;
00103     PT_DocPosition        m_iSelectRightAnchor;
00104     fl_TableLayout *      m_pTableOfSelectedColumn;
00105     fl_TOCLayout  *       m_pSelectedTOC;
00106     UT_GenericVector<PD_DocumentRange *> m_vecSelRanges;
00107     UT_GenericVector<UT_ByteBuf*> m_vecSelRTFBuffers;
00108     UT_GenericVector<FV_SelectionCellProps*> m_vecSelCellProps;
00109     bool                  m_bSelectAll;
00110 };
00111 
00112 #endif /* FV_Selection_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1