LibreOffice Module editeng (master) 1
editsel.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#include "editsel.hxx"
21#include "impedit.hxx"
22#include <editeng/editview.hxx>
23
24
25
27{
28 pCurView = nullptr;
29}
30
32{
33 if ( pCurView )
34 pCurView->pImpEditView->CreateAnchor();
35}
36
38{
39 // Only with multiple selection
40}
41
42void EditSelFunctionSet::SetCursorAtPoint( const Point& rPointPixel, bool )
43{
44 if ( pCurView )
45 pCurView->pImpEditView->SetCursorAtPoint( rPointPixel );
46}
47
49{
50 if ( pCurView )
51 return pCurView->pImpEditView->IsSelectionAtPoint( rPointPixel );
52
53 return false;
54}
55
57{
58// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
59// ! Implement when multiple selection is possible !
60// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
61}
62
64{
65 // Only with multiple selection
66}
67
68
70{
71 if ( pCurView )
72 pCurView->pImpEditView->DeselectAll();
73}
74
75
76
78{
79 SetSelectionMode( SelectionMode::Range );
80 EnableDrag( true );
81}
82
84{
85 if ( GetFunctionSet() )
86 const_cast<EditSelFunctionSet*>(static_cast<const EditSelFunctionSet*>(GetFunctionSet()))->SetCurView( pNewView );
87
88 if ( pNewView )
89 SetWindow( pNewView->GetWindow() );
90 else
91 SetWindow( nullptr );
92}
93
94/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void BeginDrag() override
Definition: editsel.cxx:63
virtual void DestroyAnchor() override
Definition: editsel.cxx:37
virtual void DeselectAtPoint(const Point &rPointPixel) override
Definition: editsel.cxx:56
virtual bool IsSelectionAtPoint(const Point &rPointPixel) override
Definition: editsel.cxx:48
virtual void CreateAnchor() override
Definition: editsel.cxx:31
virtual void SetCursorAtPoint(const Point &rPointPixel, bool bDontSelectAtCursor=false) override
Definition: editsel.cxx:42
virtual void DeselectAll() override
Definition: editsel.cxx:69
void SetCurView(EditView *pView)
Definition: editsel.hxx:45
EditView * pCurView
Definition: editsel.hxx:29
void SetCurView(EditView *pNewView)
Definition: editsel.cxx:83
vcl::Window * GetWindow() const
Definition: editview.cxx:357
std::unique_ptr< ImpEditView > pImpEditView
Definition: editview.hxx:167
void SetWindow(vcl::Window *)
void EnableDrag(bool bOn)
void SetSelectionMode(SelectionMode eMode)
const FunctionSet * GetFunctionSet() const