1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 // MARKER(update_precomp.py): autogen include statement, do not remove 25 #include "precompiled_editeng.hxx" 26 27 #include <eeng_pch.hxx> 28 29 #include <editsel.hxx> 30 #include <impedit.hxx> 31 #include <editeng/editview.hxx> 32 33 // ---------------------------------------------------------------------- 34 // class EditSelFunctionSet 35 // ---------------------------------------------------------------------- EditSelFunctionSet()36EditSelFunctionSet::EditSelFunctionSet() 37 { 38 pCurView = NULL; 39 } 40 CreateAnchor()41void __EXPORT EditSelFunctionSet::CreateAnchor() 42 { 43 if ( pCurView ) 44 pCurView->pImpEditView->CreateAnchor(); 45 } 46 DestroyAnchor()47void __EXPORT EditSelFunctionSet::DestroyAnchor() 48 { 49 // Nur bei Mehrfachselektion 50 } 51 SetCursorAtPoint(const Point & rPointPixel,sal_Bool)52sal_Bool __EXPORT EditSelFunctionSet::SetCursorAtPoint( const Point& rPointPixel, sal_Bool ) 53 { 54 if ( pCurView ) 55 return pCurView->pImpEditView->SetCursorAtPoint( rPointPixel ); 56 57 return sal_False; 58 } 59 IsSelectionAtPoint(const Point & rPointPixel)60sal_Bool __EXPORT EditSelFunctionSet::IsSelectionAtPoint( const Point& rPointPixel ) 61 { 62 if ( pCurView ) 63 return pCurView->pImpEditView->IsSelectionAtPoint( rPointPixel ); 64 65 return sal_False; 66 } 67 DeselectAtPoint(const Point &)68void __EXPORT EditSelFunctionSet::DeselectAtPoint( const Point& ) 69 { 70 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 71 // ! Implementieren, wenn Mehrfachselektion moeglich ! 72 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 73 } 74 BeginDrag()75void __EXPORT EditSelFunctionSet::BeginDrag() 76 { 77 // Nur bei Mehrfachselektion 78 } 79 80 DeselectAll()81void __EXPORT EditSelFunctionSet::DeselectAll() 82 { 83 if ( pCurView ) 84 pCurView->pImpEditView->DeselectAll(); 85 } 86 87 // ---------------------------------------------------------------------- 88 // class EditSelectionEngine 89 // ---------------------------------------------------------------------- EditSelectionEngine()90EditSelectionEngine::EditSelectionEngine() : SelectionEngine( (Window*)0 ) 91 { 92 // Wegen Bug OV: (1994) 93 // 1995: RangeSelection lassen, SingleSelection nur fuer ListBoxen geeignet! 94 SetSelectionMode( RANGE_SELECTION ); 95 EnableDrag( sal_True ); 96 } 97 SetCurView(EditView * pNewView)98void EditSelectionEngine::SetCurView( EditView* pNewView ) 99 { 100 if ( GetFunctionSet() ) 101 ((EditSelFunctionSet*)GetFunctionSet())->SetCurView( pNewView ); 102 103 if ( pNewView ) 104 SetWindow( pNewView->GetWindow() ); 105 else 106 SetWindow( (Window*)0 ); 107 } 108 GetCurView()109EditView* EditSelectionEngine::GetCurView() 110 { 111 EditView* pView = 0; 112 if ( GetFunctionSet() ) 113 pView = ((EditSelFunctionSet*)GetFunctionSet())->GetCurView(); 114 115 return pView; 116 } 117 118