update dev300-m58
[ooovba.git] / starmath / inc / edit.hxx
blob87b7ecef366ff84572f1376cd8526387d8290926
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();
103 public:
104 SmEditWindow( SmCmdBoxWindow &rMyCmdBoxWin );
105 ~SmEditWindow();
107 SmDocShell * GetDoc();
108 SmViewShell * GetView();
109 EditView * GetEditView() { return pEditView; }
110 EditEngine * GetEditEngine();
111 SfxItemPool * GetEditEngineItemPool();
113 // Window
114 virtual void SetText(const XubString &rText);
115 virtual String GetText() const;
116 virtual void GetFocus();
117 virtual void LoseFocus();
119 ESelection GetSelection() const;
120 void SetSelection(const ESelection &rSel);
122 BOOL IsEmpty() const;
123 BOOL IsSelected() const;
124 BOOL IsAllSelected() const;
125 void Cut();
126 void Copy();
127 void Paste();
128 void Delete();
129 void SelectAll();
130 void InsertText(const String &rText);
131 void InsertCommand(USHORT nCommand);
132 void MarkError(const Point &rPos);
133 void SelNextMark();
134 void SelPrevMark();
135 BOOL HasMark(const String &rText) const;
137 void Flush();
138 void DeleteEditView( SmViewShell &rView );
140 void ApplyColorConfigValues( const svtools::ColorConfig &rColorCfg );
142 BOOL HandleWheelCommands( const CommandEvent &rCEvt );
144 // for Accessibility
145 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
147 using Window::GetAccessible;
148 SmEditAccessible * GetAccessible() { return pAccessible; }
152 #endif