android: Update app-specific/MIME type icons
[LibreOffice.git] / starmath / inc / edit.hxx
blob2fd6fac636b4e88e5871b58ea5b71e5affe0184e
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 .
20 #pragma once
22 #include <svx/weldeditview.hxx>
23 #include <vcl/idle.hxx>
25 class SmDocShell;
26 class SmViewShell;
27 class EditView;
28 class EditEngine;
29 class EditStatus;
30 class DataChangedEvent;
31 class SmCmdBoxWindow;
32 class CommandEvent;
33 class Timer;
35 void SmGetLeftSelectionPart(const ESelection& rSelection, sal_Int32& nPara, sal_uInt16& nPos);
37 class SmEditWindow;
39 class SmEditTextWindow : public WeldEditView
41 private:
42 SmEditWindow& mrEditWindow;
44 Idle aModifyIdle;
45 Idle aCursorMoveIdle;
47 ESelection aOldSelection;
49 DECL_LINK(ModifyTimerHdl, Timer*, void);
50 DECL_LINK(CursorMoveTimerHdl, Timer*, void);
51 DECL_LINK(EditStatusHdl, EditStatus&, void);
53 public:
54 SmEditTextWindow(SmEditWindow& rEditWindow);
55 virtual ~SmEditTextWindow() override;
57 virtual EditEngine* GetEditEngine() const override;
59 virtual void EditViewScrollStateChange() override;
61 virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
63 virtual bool KeyInput(const KeyEvent& rKeyEvt) override;
64 virtual bool MouseButtonUp(const MouseEvent& rEvt) override;
65 virtual bool Command(const CommandEvent& rCEvt) override;
66 virtual void GetFocus() override;
67 virtual void LoseFocus() override;
68 virtual void StyleUpdated() override;
70 void SetText(const OUString& rText);
71 void InsertText(const OUString& rText);
72 void SelNextMark();
73 ESelection GetSelection() const;
74 void UserPossiblyChangedText();
75 void Flush();
76 void UpdateStatus(bool bSetDocModified);
77 void StartCursorMove();
80 class SmEditWindow final
82 SmCmdBoxWindow& rCmdBox;
83 std::unique_ptr<weld::ScrolledWindow> mxScrolledWindow;
84 std::unique_ptr<SmEditTextWindow> mxTextControl;
85 std::unique_ptr<weld::CustomWeld> mxTextControlWin;
87 DECL_LINK(ScrollHdl, weld::ScrolledWindow&, void);
89 void CreateEditView(weld::Builder& rBuilder);
91 public:
92 SmEditWindow(SmCmdBoxWindow& rMyCmdBoxWin, weld::Builder& rBuilder);
93 ~SmEditWindow() COVERITY_NOEXCEPT_FALSE;
95 weld::Window* GetFrameWeld() const;
97 SmDocShell* GetDoc();
98 SmViewShell* GetView();
99 EditView* GetEditView() const;
100 EditEngine* GetEditEngine();
101 SmCmdBoxWindow& GetCmdBox() const { return rCmdBox; }
103 void SetText(const OUString& rText);
104 OUString GetText() const;
105 void Flush();
106 void GrabFocus();
108 css::uno::Reference<css::datatransfer::clipboard::XClipboard> GetClipboard() const
110 return mxTextControl->GetClipboard();
113 ESelection GetSelection() const;
114 void SetSelection(const ESelection& rSel);
115 void UpdateStatus();
117 bool IsEmpty() const;
118 bool IsSelected() const;
119 bool IsAllSelected() const;
120 void SetScrollBarRanges();
121 tools::Rectangle AdjustScrollBars();
122 void InvalidateSlots();
123 void Cut();
124 void Copy();
125 void Paste();
126 void Delete();
127 void SelectAll();
128 void InsertText(const OUString& rText);
129 void MarkError(const Point& rPos);
130 void SelNextMark();
131 void SelPrevMark();
133 void DeleteEditView();
136 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */