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 51673 : EditSelFunctionSet::EditSelFunctionSet()
32 : {
33 51673 : pCurView = NULL;
34 51673 : }
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 0 : bool EditSelFunctionSet::SetCursorAtPoint( const Point& rPointPixel, bool )
48 : {
49 0 : if ( pCurView )
50 0 : return pCurView->pImpEditView->SetCursorAtPoint( rPointPixel );
51 :
52 0 : return false;
53 : }
54 :
55 0 : bool EditSelFunctionSet::IsSelectionAtPoint( const Point& rPointPixel )
56 : {
57 0 : if ( pCurView )
58 0 : 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 0 : void EditSelFunctionSet::DeselectAll()
77 : {
78 0 : if ( pCurView )
79 0 : pCurView->pImpEditView->DeselectAll();
80 0 : }
81 :
82 :
83 : // class EditSelectionEngine
84 :
85 51673 : EditSelectionEngine::EditSelectionEngine() : SelectionEngine( (vcl::Window*)0 )
86 : {
87 51673 : SetSelectionMode( RANGE_SELECTION );
88 51673 : EnableDrag( true );
89 51673 : }
90 :
91 82 : void EditSelectionEngine::SetCurView( EditView* pNewView )
92 : {
93 82 : if ( GetFunctionSet() )
94 82 : const_cast<EditSelFunctionSet*>(static_cast<const EditSelFunctionSet*>(GetFunctionSet()))->SetCurView( pNewView );
95 :
96 82 : if ( pNewView )
97 0 : SetWindow( pNewView->GetWindow() );
98 : else
99 82 : SetWindow( (vcl::Window*)0 );
100 751 : }
101 :
102 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|