fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / include / vcl / textview.hxx
blob9873d89df4949e6372bb582f9a40b6f3eea2763b
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 #ifndef _TEXTVIEW_HXX
21 #define _TEXTVIEW_HXX
23 #include <vcl/dllapi.h>
24 #include <vcl/textdata.hxx>
25 #include <tools/gen.hxx>
26 #include <vcl/dndhelp.hxx>
28 class TextEngine;
29 class OutputDevice;
30 class Window;
31 class Cursor;
32 class KeyEvent;
33 class MouseEvent;
34 class CommandEvent;
35 class TextSelFunctionSet;
36 class SelectionEngine;
37 class VirtualDevice;
38 struct TextDDInfo;
40 namespace com {
41 namespace sun {
42 namespace star {
43 namespace datatransfer {
44 namespace clipboard {
45 class XClipboard;
46 }}}}}
48 struct ImpTextView;
50 class VCL_DLLPUBLIC TextView : public vcl::unohelper::DragAndDropClient
52 friend class TextEngine;
53 friend class TextUndo;
54 friend class TextUndoManager;
55 friend class TextSelFunctionSet;
56 friend class ExtTextView;
58 private:
59 ImpTextView* mpImpl;
61 TextView( const TextView& ) : vcl::unohelper::DragAndDropClient() {}
62 TextView& operator=( const TextView& ) { return *this; }
64 protected:
65 void ShowSelection();
66 void HideSelection();
67 void ShowSelection( const TextSelection& rSel );
68 void ImpShowHideSelection( sal_Bool bShow, const TextSelection* pRange = NULL );
70 TextSelection ImpMoveCursor( const KeyEvent& rKeyEvent );
71 TextPaM ImpDelete( sal_uInt8 nMode, sal_uInt8 nDelMode );
72 void ImpSetSelection( const TextSelection& rNewSel, sal_Bool bUI );
73 sal_Bool IsInSelection( const TextPaM& rPaM );
75 void ImpPaint( OutputDevice* pOut, const Point& rStartPos, Rectangle const* pPaintArea, TextSelection const* pPaintRange = 0, TextSelection const* pSelection = 0 );
76 void ImpPaint( const Rectangle& rRect, sal_Bool bUseVirtDev );
77 void ImpShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, sal_Bool bEndKey );
78 void ImpHighlight( const TextSelection& rSel );
79 void ImpSetSelection( const TextSelection& rSelection );
80 Point ImpGetOutputStartPos( const Point& rStartDocPos ) const;
82 void ImpHideDDCursor();
83 void ImpShowDDCursor();
85 bool ImplTruncateNewText( OUString& rNewText ) const;
86 sal_Bool ImplCheckTextLen( const String& rNewText );
88 VirtualDevice* GetVirtualDevice();
90 // DragAndDropClient
91 virtual void dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent& dge ) throw (::com::sun::star::uno::RuntimeException);
92 virtual void dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSourceDropEvent& dsde ) throw (::com::sun::star::uno::RuntimeException);
93 virtual void drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& dtde ) throw (::com::sun::star::uno::RuntimeException);
94 virtual void dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent& dtdee ) throw (::com::sun::star::uno::RuntimeException);
95 virtual void dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& dte ) throw (::com::sun::star::uno::RuntimeException);
96 virtual void dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& dtde ) throw (::com::sun::star::uno::RuntimeException);
98 using DragAndDropClient::dragEnter;
99 using DragAndDropClient::dragExit;
100 using DragAndDropClient::dragOver;
102 public:
103 TextView( TextEngine* pEng, Window* pWindow );
104 virtual ~TextView();
106 TextEngine* GetTextEngine() const;
107 Window* GetWindow() const;
109 void Invalidate();
110 void Scroll( long nHorzScroll, long nVertScroll );
112 void ShowCursor( sal_Bool bGotoCursor = sal_True, sal_Bool bForceVisCursor = sal_True );
113 void HideCursor();
115 void EnableCursor( sal_Bool bEnable );
116 sal_Bool IsCursorEnabled() const;
118 const TextSelection& GetSelection() const;
119 TextSelection& GetSelection();
120 void SetSelection( const TextSelection& rNewSel );
121 void SetSelection( const TextSelection& rNewSel, sal_Bool bGotoCursor );
122 sal_Bool HasSelection() const;
124 String GetSelected();
125 String GetSelected( LineEnd aSeparator );
126 void DeleteSelected();
128 void InsertText( const OUString& rNew, sal_Bool bSelect = sal_False );
130 sal_Bool KeyInput( const KeyEvent& rKeyEvent );
131 void Paint( const Rectangle& rRect );
132 void MouseButtonUp( const MouseEvent& rMouseEvent );
133 void MouseButtonDown( const MouseEvent& rMouseEvent );
134 void MouseMove( const MouseEvent& rMouseEvent );
135 void Command( const CommandEvent& rCEvt );
137 void Cut();
138 void Copy();
139 void Paste();
141 void Copy( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard );
142 void Paste( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard );
144 void Undo();
145 void Redo();
147 sal_Bool Read( SvStream& rInput );
149 void SetStartDocPos( const Point& rPos );
150 const Point& GetStartDocPos() const;
152 Point GetDocPos( const Point& rWindowPos ) const;
153 Point GetWindowPos( const Point& rDocPos ) const;
155 void SetInsertMode( sal_Bool bInsert );
156 sal_Bool IsInsertMode() const;
158 void SetAutoIndentMode( sal_Bool bAutoIndent );
160 void SetReadOnly( sal_Bool bReadOnly );
161 sal_Bool IsReadOnly() const;
163 void SetAutoScroll( sal_Bool bAutoScroll );
164 sal_Bool IsAutoScroll() const;
166 sal_Bool SetCursorAtPoint( const Point& rPointPixel );
167 sal_Bool IsSelectionAtPoint( const Point& rPointPixel );
169 void SetPaintSelection( sal_Bool bPaint);
171 void EraseVirtualDevice();
173 // aus dem protected Teil hierher verschoben
174 // F�r 'SvtXECTextCursor' (TL). Mu� ggf nochmal anders gel�st werden.
175 TextPaM PageUp( const TextPaM& rPaM );
176 TextPaM PageDown( const TextPaM& rPaM );
177 TextPaM CursorUp( const TextPaM& rPaM );
178 TextPaM CursorDown( const TextPaM& rPaM );
179 TextPaM CursorLeft( const TextPaM& rPaM, sal_uInt16 nCharacterIteratorMode );
180 TextPaM CursorRight( const TextPaM& rPaM, sal_uInt16 nCharacterIteratorMode );
181 TextPaM CursorWordLeft( const TextPaM& rPaM );
182 TextPaM CursorWordRight( const TextPaM& rPaM );
183 TextPaM CursorStartOfLine( const TextPaM& rPaM );
184 TextPaM CursorEndOfLine( const TextPaM& rPaM );
185 TextPaM CursorStartOfParagraph( const TextPaM& rPaM );
186 TextPaM CursorEndOfParagraph( const TextPaM& rPaM );
187 TextPaM CursorStartOfDoc();
188 TextPaM CursorEndOfDoc();
191 Drag and Drop, deleting and selection regards all text that has an attribute
192 TEXTATTR_PROTECTED set as one entitity. Drag and dropped text is automatically
193 attibuted as protected.
195 void SupportProtectAttribute(sal_Bool bSupport);
198 Returns the number in paragraph of the line in which the cursor is blinking
199 if enabled, -1 otherwise.
201 sal_Int32 GetLineNumberOfCursorInSelection() const;
204 #endif // _TEXTVIEW_HXX
206 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */