1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
22 #include <vcl/window.hxx>
23 #include <vcl/timer.hxx>
24 #include <svtools/transfer.hxx>
25 #include <editeng/editdata.hxx>
26 #include <svtools/colorcfg.hxx>
35 class DataChangedEvent
;
38 class SmEditAccessible
;
41 /**************************************************************************/
43 void SmGetLeftSelectionPart(const ESelection
&rSelection
,
44 sal_Int32
&nPara
, sal_uInt16
&nPos
);
46 /**************************************************************************/
48 class SmEditWindow
: public Window
, public DropTargetHelper
50 ::com::sun::star::uno::Reference
<
51 ::com::sun::star::accessibility::XAccessible
> xAccessible
;
52 SmEditAccessible
* pAccessible
;
54 SmCmdBoxWindow
&rCmdBox
;
56 ScrollBar
*pHScrollBar
,
58 ScrollBarBox
*pScrollBox
;
61 ESelection aOldSelection
;
63 virtual void KeyInput(const KeyEvent
& rKEvt
);
64 virtual void Command(const CommandEvent
& rCEvt
);
65 DECL_LINK(MenuSelectHdl
, Menu
*);
66 DECL_LINK(ModifyTimerHdl
, Timer
*);
67 DECL_LINK(CursorMoveTimerHdl
, Timer
*);
69 virtual void DataChanged( const DataChangedEvent
& );
70 virtual void Resize();
71 virtual void MouseMove(const MouseEvent
&rEvt
);
72 virtual void MouseButtonUp(const MouseEvent
&rEvt
);
73 virtual void MouseButtonDown(const MouseEvent
&rEvt
);
75 virtual sal_Int8
AcceptDrop( const AcceptDropEvent
& rEvt
);
76 virtual sal_Int8
ExecuteDrop( const ExecuteDropEvent
& rEvt
);
77 virtual void Paint(const Rectangle
& rRect
);
79 DECL_LINK(EditStatusHdl
,EditStatus
*);
80 DECL_LINK(ScrollHdl
, ScrollBar
*);
82 void CreateEditView();
84 Rectangle
AdjustScrollBars();
85 void SetScrollBarRanges();
86 void InitScrollBars();
87 void InvalidateSlots();
88 void UpdateStatus( bool bSetDocModified
= false );
91 SmEditWindow( SmCmdBoxWindow
&rMyCmdBoxWin
);
94 SmDocShell
* GetDoc();
95 SmViewShell
* GetView();
96 EditView
* GetEditView() { return pEditView
; }
97 EditEngine
* GetEditEngine();
98 SfxItemPool
* GetEditEngineItemPool();
101 virtual void SetText(const OUString
&rText
);
102 virtual OUString
GetText() const;
103 virtual void GetFocus();
104 virtual void LoseFocus();
106 ESelection
GetSelection() const;
107 void SetSelection(const ESelection
&rSel
);
109 bool IsEmpty() const;
110 bool IsSelected() const;
111 bool IsAllSelected() const;
117 void InsertText(const OUString
&rText
);
118 void InsertCommand(sal_uInt16 nCommand
);
119 void MarkError(const Point
&rPos
);
122 bool HasMark(const OUString
&rText
) const;
125 void DeleteEditView( SmViewShell
&rView
);
127 void ApplyColorConfigValues( const svtools::ColorConfig
&rColorCfg
);
129 bool HandleWheelCommands( const CommandEvent
&rCEvt
);
130 bool IsInlineEditEnabled();
131 void StartCursorMove();
134 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> CreateAccessible();
136 using Window::GetAccessible
;
137 SmEditAccessible
* GetAccessible() { return pAccessible
; }
143 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */