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 SD_FU_TEXT_HXX
21 #define SD_FU_TEXT_HXX
23 #include <editeng/editdata.hxx>
24 #include "fuconstr.hxx"
25 #include <svx/svdotext.hxx>
27 struct StyleRequestData
;
35 * Base class for text functions
43 static FunctionReference
Create( ViewShell
* pViewSh
, ::sd::Window
* pWin
, ::sd::View
* pView
, SdDrawDocument
* pDoc
, SfxRequest
& rReq
);
44 virtual void DoExecute( SfxRequest
& rReq
);
46 virtual sal_Bool
KeyInput(const KeyEvent
& rKEvt
);
47 virtual sal_Bool
MouseMove(const MouseEvent
& rMEvt
);
48 virtual sal_Bool
MouseButtonUp(const MouseEvent
& rMEvt
);
49 virtual sal_Bool
MouseButtonDown(const MouseEvent
& rMEvt
);
50 virtual sal_Bool
Command(const CommandEvent
& rCEvt
);
51 virtual sal_Bool
RequestHelp(const HelpEvent
& rHEvt
);
52 virtual void ReceiveRequest(SfxRequest
& rReq
);
53 virtual void DoubleClick(const MouseEvent
& rMEvt
);
55 virtual void Activate(); ///< activates the function
56 virtual void Deactivate(); ///< deactivates the function
58 void SetInEditMode(const MouseEvent
& rMEvt
, sal_Bool bQuickDrag
);
59 sal_Bool
DeleteDefaultText();
60 SdrTextObj
* GetTextObj() { return static_cast< SdrTextObj
* >( mxTextObj
.get() ); }
62 virtual SdrObject
* CreateDefaultObject(const sal_uInt16 nID
, const Rectangle
& rRectangle
);
64 /** is called when the currenct function should be aborted. <p>
65 This is used when a function gets a KEY_ESCAPE but can also
68 @returns true if a active function was aborted
70 virtual bool cancel();
72 static void ChangeFontSize( bool, OutlinerView
*, const FontList
*, ::sd::View
* );
75 FuText (ViewShell
* pViewSh
,
81 virtual void disposing();
83 SdrObjectWeakRef mxTextObj
;
85 sal_Bool bFirstObjCreated
;
91 void ImpSetAttributesForNewTextObject(SdrTextObj
* pTxtObj
);
92 void ImpSetAttributesFitToSize(SdrTextObj
* pTxtObj
);
93 void ImpSetAttributesFitToSizeVertical(SdrTextObj
* pTxtObj
);
94 void ImpSetAttributesFitCommon(SdrTextObj
* pTxtObj
);
97 } // end of namespace sd
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */