fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / starmath / inc / edit.hxx
bloba9d9ca465be47eaea74499fed0485e723654b310
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
19 #ifndef EDIT_HXX
20 #define EDIT_HXX
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>
28 class SmDocShell;
29 class SmViewShell;
30 class EditView;
31 class EditEngine;
32 class EditStatus;
33 class ScrollBar;
34 class ScrollBarBox;
35 class DataChangedEvent;
36 class Menu;
37 class SmCmdBoxWindow;
38 class SmEditAccessible;
39 class CommandEvent;
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;
55 EditView *pEditView;
56 ScrollBar *pHScrollBar,
57 *pVScrollBar;
58 ScrollBarBox *pScrollBox;
59 Timer aModifyTimer,
60 aCursorMoveTimer;
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 );
90 public:
91 SmEditWindow( SmCmdBoxWindow &rMyCmdBoxWin );
92 ~SmEditWindow();
94 SmDocShell * GetDoc();
95 SmViewShell * GetView();
96 EditView * GetEditView() { return pEditView; }
97 EditEngine * GetEditEngine();
98 SfxItemPool * GetEditEngineItemPool();
100 // Window
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;
112 void Cut();
113 void Copy();
114 void Paste();
115 void Delete();
116 void SelectAll();
117 void InsertText(const OUString &rText);
118 void InsertCommand(sal_uInt16 nCommand);
119 void MarkError(const Point &rPos);
120 void SelNextMark();
121 void SelPrevMark();
122 bool HasMark(const OUString &rText) const;
124 void Flush();
125 void DeleteEditView( SmViewShell &rView );
127 void ApplyColorConfigValues( const svtools::ColorConfig &rColorCfg );
129 bool HandleWheelCommands( const CommandEvent &rCEvt );
130 bool IsInlineEditEnabled();
131 void StartCursorMove();
133 // for Accessibility
134 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
136 using Window::GetAccessible;
137 SmEditAccessible * GetAccessible() { return pAccessible; }
141 #endif
143 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */