1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SVX_SELECTIONCONTROLLER_HXX
21 #define INCLUDED_SVX_SELECTIONCONTROLLER_HXX
23 #include <svx/svxdllapi.h>
24 #include <cppuhelper/weak.hxx>
29 namespace vcl
{ class Window
; }
41 namespace table
{ struct CellPos
; }
43 class SVX_DLLPUBLIC SelectionController
: public cppu::OWeakObject
46 virtual bool onKeyInput(const KeyEvent
& rKEvt
, vcl::Window
* pWin
);
47 virtual bool onMouseButtonDown(const MouseEvent
& rMEvt
, vcl::Window
* pWin
);
48 virtual bool onMouseButtonUp(const MouseEvent
& rMEvt
, vcl::Window
* pWin
);
49 virtual bool onMouseMove(const MouseEvent
& rMEvt
, vcl::Window
* pWin
);
51 virtual void onSelectionHasChanged();
53 virtual void GetState( SfxItemSet
& rSet
);
54 virtual void Execute( SfxRequest
& rReq
);
56 virtual bool DeleteMarked();
58 virtual bool GetAttributes(SfxItemSet
& rTargetSet
, bool bOnlyHardAttr
) const;
59 virtual bool SetAttributes(const SfxItemSet
& rSet
, bool bReplaceAll
);
61 virtual bool GetStyleSheet( SfxStyleSheet
* &rpStyleSheet
) const;
62 virtual bool SetStyleSheet( SfxStyleSheet
* pStyleSheet
, bool bDontRemoveHardAttr
);
64 virtual SdrObject
* GetMarkedSdrObjClone( SdrModel
& rTargetModel
);
65 virtual bool PasteObjModel( const SdrModel
& rModel
);
67 /** applies a format paint brush set from the current selection.
68 if bNoCharacterFormats is true, no character attributes are changed.
69 if bNoParagraphFormats is true, no paragraph attributes are changed.
71 virtual bool ApplyFormatPaintBrush( SfxItemSet
& rFormatSet
, bool bNoCharacterFormats
, bool bNoParagraphFormats
);
72 /// This is a table object, and one or more of its cells are selected.
73 virtual bool hasSelectedCells() const;
74 /// Allows adjusting the point or mark of the selection to a document coordinate.
75 virtual bool setCursorLogicPosition(const Point
& rPosition
, bool bPoint
);
76 /// Get the position of the first and the last selected cell.
77 virtual void getSelectedCells(table::CellPos
& rFirstPos
, table::CellPos
& rLastPos
);
78 /// Changes the font (grow/shrink) according to the input parameters.
79 virtual bool ChangeFontSize(bool bGrow
, const FontList
* pFontList
);
84 #endif // INCLUDED_SVX_SELECTIONCONTROLLER_HXX
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */