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 #ifndef _SELECTIONCONTROLLER_HXX 25 #define _SELECTIONCONTROLLER_HXX 26 27 #include "svx/svxdllapi.h" 28 29 #include <boost/shared_ptr.hpp> 30 31 #include <cppuhelper/weak.hxx> 32 33 class KeyEvent; 34 class MouseEvent; 35 class Window; 36 class SfxItemSet; 37 class SfxRequest; 38 class SfxStyleSheet; 39 class SdrPage; 40 class SdrModel; 41 42 namespace sdr 43 { 44 45 class SVX_DLLPUBLIC SelectionController: public cppu::OWeakObject 46 { 47 public: 48 virtual bool onKeyInput(const KeyEvent& rKEvt, Window* pWin); 49 virtual bool onMouseButtonDown(const MouseEvent& rMEvt, Window* pWin); 50 virtual bool onMouseButtonUp(const MouseEvent& rMEvt, Window* pWin); 51 virtual bool onMouseMove(const MouseEvent& rMEvt, Window* pWin); 52 53 virtual void onSelectionHasChanged(); 54 55 virtual void GetState( SfxItemSet& rSet ); 56 virtual void Execute( SfxRequest& rReq ); 57 58 virtual bool DeleteMarked(); 59 60 virtual bool GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) const; 61 virtual bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll); 62 63 virtual bool GetStyleSheet( SfxStyleSheet* &rpStyleSheet ) const; 64 virtual bool SetStyleSheet( SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr ); 65 66 virtual bool GetMarkedObjModel( SdrPage* pNewPage ); 67 virtual bool PasteObjModel( const SdrModel& rModel ); 68 69 /** returns a format paint brush set from the current selection */ 70 virtual bool TakeFormatPaintBrush( boost::shared_ptr< SfxItemSet >& rFormatSet ); 71 72 /** applies a format paint brush set from the current selection. 73 if bNoCharacterFormats is true, no character attributes are changed. 74 if bNoParagraphFormats is true, no paragraph attributes are changed. 75 */ 76 virtual bool ApplyFormatPaintBrush( SfxItemSet& rFormatSet, bool bNoCharacterFormats, bool bNoParagraphFormats ); 77 }; 78 79 } 80 81 #endif //_SELECTIONCONTROLLER_HXX 82 83