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

fv_SelectionHandles.h

Go to the documentation of this file.
00001 /* AbiWord - base class for selection handles
00002  * Copyright (c) 2012 One laptop per child
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  * Author: Carlos Garnacho <carlos@lanedo.com>
00020  */
00021 
00022 #ifndef FV_SELECTIONHANDLES_H
00023 #define FV_SELECTIONHANDLES_H
00024 
00025 #include "pt_Types.h"
00026 #include "fv_Selection.h"
00027 
00028 class FV_View;
00029 
00030 class ABI_EXPORT FV_SelectionHandles
00031 {
00032 public:
00033     FV_SelectionHandles (FV_View * pView, FV_Selection selection);
00034     virtual ~FV_SelectionHandles();
00035 
00036     virtual void hide(void) {}
00037     virtual void setCursorCoords(UT_sint32 /*x*/, UT_sint32 /*y*/, UT_uint32 /*height*/, bool /*visible*/) {}
00038     virtual void setSelectionCoords(UT_sint32 /*start_x*/, UT_sint32 /*start_y*/, UT_uint32 /*start_height*/, bool /*start_visible*/,
00039                                     UT_sint32 /*end_x*/, UT_sint32 /*end_y*/, UT_uint32 /*end_height*/, bool /*end_visible*/) {}
00040 
00041     void setCursor(PT_DocPosition cursor);
00042     void setSelection(PT_DocPosition start, PT_DocPosition end);
00043 
00044     void updateSelectionStart(UT_sint32 x, UT_sint32 y);
00045     void updateSelectionEnd(UT_sint32 x, UT_sint32 y);
00046     void updateCursor(UT_sint32 x, UT_sint32 y);
00047 
00048 protected:
00049     FV_View *             m_pView;
00050     FV_Selection          m_pSelection;
00051 
00052 private:
00053     bool _getPositionCoords(PT_DocPosition pos, UT_sint32& x, UT_sint32& y, UT_uint32& height);
00054 };
00055 
00056 #endif /* FV_SELECTIONHANDLES_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1