merge the formfield patch from ooo-build
[ooovba.git] / starmath / inc / edit.hxx
blobc6e3121ced6963fd90b41174398361ddf08ee569
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: edit.hxx,v $
10 * $Revision: 1.15 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef EDIT_HXX
31 #define EDIT_HXX
33 #include <vcl/window.hxx>
34 #include <vcl/timer.hxx>
35 #include <svtools/transfer.hxx>
36 #include <svx/editdata.hxx>
37 #include <svtools/colorcfg.hxx>
39 //#ifndef _ACCESSIBILITY_HXX_
40 //#include "accessibility.hxx"
41 //#endif
43 class SmDocShell;
44 class SmViewShell;
45 class EditView;
46 class EditEngine;
47 class EditStatus;
48 class ScrollBar;
49 class ScrollBarBox;
50 class DataChangedEvent;
51 class Menu;
52 class SmCmdBoxWindow;
53 class SmEditAccessible;
54 class CommandEvent;
56 /**************************************************************************/
58 void SmGetLeftSelectionPart(const ESelection aSelection,
59 USHORT &nPara, USHORT &nPos);
61 /**************************************************************************/
63 class SmEditWindow : public Window, public DropTargetHelper
65 ::com::sun::star::uno::Reference<
66 ::com::sun::star::accessibility::XAccessible > xAccessible;
67 SmEditAccessible * pAccessible;
69 SmCmdBoxWindow &rCmdBox;
70 EditView *pEditView;
71 ScrollBar *pHScrollBar,
72 *pVScrollBar;
73 ScrollBarBox *pScrollBox;
74 Timer aModifyTimer,
75 aCursorMoveTimer;
76 ESelection aOldSelection;
78 virtual void KeyInput(const KeyEvent& rKEvt);
79 virtual void Command(const CommandEvent& rCEvt);
80 DECL_LINK(MenuSelectHdl, Menu *);
81 DECL_LINK(ModifyTimerHdl, Timer *);
82 DECL_LINK(CursorMoveTimerHdl, Timer *);
84 virtual void DataChanged( const DataChangedEvent& );
85 virtual void Resize();
86 virtual void MouseMove(const MouseEvent &rEvt);
87 virtual void MouseButtonUp(const MouseEvent &rEvt);
88 virtual void MouseButtonDown(const MouseEvent &rEvt);
90 virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
91 virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
92 virtual void Paint(const Rectangle& rRect);
94 DECL_LINK(EditStatusHdl ,EditStatus *);
95 DECL_LINK(ScrollHdl, ScrollBar *);
97 void CreateEditView();
99 Rectangle AdjustScrollBars();
100 void SetScrollBarRanges();
101 void InitScrollBars();
102 void InvalidateSlots();
104 public:
105 SmEditWindow( SmCmdBoxWindow &rMyCmdBoxWin );
106 ~SmEditWindow();
108 SmDocShell * GetDoc();
109 SmViewShell * GetView();
110 EditView * GetEditView() { return pEditView; }
111 EditEngine * GetEditEngine();
112 SfxItemPool * GetEditEngineItemPool();
114 // Window
115 virtual void SetText(const XubString &rText);
116 virtual String GetText() const;
117 virtual void GetFocus();
118 virtual void LoseFocus();
120 ESelection GetSelection() const;
121 void SetSelection(const ESelection &rSel);
123 BOOL IsEmpty() const;
124 BOOL IsSelected() const;
125 BOOL IsAllSelected() const;
126 void Cut();
127 void Copy();
128 void Paste();
129 void Delete();
130 void SelectAll();
131 void InsertText(const String &rText);
132 void InsertCommand(USHORT nCommand);
133 void MarkError(const Point &rPos);
134 void SelNextMark();
135 void SelPrevMark();
136 BOOL HasMark(const String &rText) const;
138 void Flush();
139 void DeleteEditView( SmViewShell &rView );
141 void ApplyColorConfigValues( const svtools::ColorConfig &rColorCfg );
143 BOOL HandleWheelCommands( const CommandEvent &rCEvt );
145 // for Accessibility
146 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
148 using Window::GetAccessible;
149 SmEditAccessible * GetAccessible() { return pAccessible; }
153 #endif