1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: edit.hxx,v $
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 ************************************************************************/
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"
50 class DataChangedEvent
;
53 class SmEditAccessible
;
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
;
71 ScrollBar
*pHScrollBar
,
73 ScrollBarBox
*pScrollBox
;
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();
104 SmEditWindow( SmCmdBoxWindow
&rMyCmdBoxWin
);
107 SmDocShell
* GetDoc();
108 SmViewShell
* GetView();
109 EditView
* GetEditView() { return pEditView
; }
110 EditEngine
* GetEditEngine();
111 SfxItemPool
* GetEditEngineItemPool();
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;
130 void InsertText(const String
&rText
);
131 void InsertCommand(USHORT nCommand
);
132 void MarkError(const Point
&rPos
);
135 BOOL
HasMark(const String
&rText
) const;
138 void DeleteEditView( SmViewShell
&rView
);
140 void ApplyColorConfigValues( const svtools::ColorConfig
&rColorCfg
);
142 BOOL
HandleWheelCommands( const CommandEvent
&rCEvt
);
145 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> CreateAccessible();
147 using Window::GetAccessible
;
148 SmEditAccessible
* GetAccessible() { return pAccessible
; }