Line data Source code
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 <vcl/wrkwin.hxx>
21 : #include <vcl/dialog.hxx>
22 : #include <vcl/msgbox.hxx>
23 : #include <vcl/svapp.hxx>
24 : #include <editsel.hxx>
25 : #include <impedit.hxx>
26 : #include <editeng/editview.hxx>
27 :
28 :
29 : // class EditSelFunctionSet
30 :
31 42102 : EditSelFunctionSet::EditSelFunctionSet()
32 : {
33 42102 : pCurView = NULL;
34 42102 : }
35 :
36 0 : void EditSelFunctionSet::CreateAnchor()
37 : {
38 0 : if ( pCurView )
39 0 : pCurView->pImpEditView->CreateAnchor();
40 0 : }
41 :
42 0 : void EditSelFunctionSet::DestroyAnchor()
43 : {
44 : // Only with multiple selection
45 0 : }
46 :
47 1 : bool EditSelFunctionSet::SetCursorAtPoint( const Point& rPointPixel, bool )
48 : {
49 1 : if ( pCurView )
50 1 : return pCurView->pImpEditView->SetCursorAtPoint( rPointPixel );
51 :
52 0 : return false;
53 : }
54 :
55 1 : bool EditSelFunctionSet::IsSelectionAtPoint( const Point& rPointPixel )
56 : {
57 1 : if ( pCurView )
58 1 : return pCurView->pImpEditView->IsSelectionAtPoint( rPointPixel );
59 :
60 0 : return false;
61 : }
62 :
63 0 : void EditSelFunctionSet::DeselectAtPoint( const Point& )
64 : {
65 : // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
66 : // ! Implement when multiple selection is possible !
67 : // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
68 0 : }
69 :
70 0 : void EditSelFunctionSet::BeginDrag()
71 : {
72 : // Only with multiple selection
73 0 : }
74 :
75 :
76 1 : void EditSelFunctionSet::DeselectAll()
77 : {
78 1 : if ( pCurView )
79 1 : pCurView->pImpEditView->DeselectAll();
80 1 : }
81 :
82 :
83 : // class EditSelectionEngine
84 :
85 42102 : EditSelectionEngine::EditSelectionEngine() : SelectionEngine( nullptr )
86 : {
87 42102 : SetSelectionMode( RANGE_SELECTION );
88 42102 : EnableDrag( true );
89 42102 : }
90 :
91 54 : void EditSelectionEngine::SetCurView( EditView* pNewView )
92 : {
93 54 : if ( GetFunctionSet() )
94 54 : const_cast<EditSelFunctionSet*>(static_cast<const EditSelFunctionSet*>(GetFunctionSet()))->SetCurView( pNewView );
95 :
96 54 : if ( pNewView )
97 2 : SetWindow( pNewView->GetWindow() );
98 : else
99 52 : SetWindow( nullptr );
100 54 : }
101 :
102 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|