bump product version to 6.3.0.0.beta1
[LibreOffice.git] / sd / source / ui / inc / futext.hxx
blobc5a15467b7502f56aa143e8adf81d363b9c23f08
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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_SD_SOURCE_UI_INC_FUTEXT_HXX
21 #define INCLUDED_SD_SOURCE_UI_INC_FUTEXT_HXX
23 #include "fuconstr.hxx"
24 #include <tools/weakbase.h>
26 class SdrTextObj;
27 class FontList;
28 class OutlinerView;
30 namespace sd {
32 /**
33 * Base class for text functions
35 class FuText
36 : public FuConstruct
38 public:
40 static rtl::Reference<FuPoor> Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
41 virtual void DoExecute( SfxRequest& rReq ) override;
43 virtual bool KeyInput(const KeyEvent& rKEvt) override;
44 virtual bool MouseMove(const MouseEvent& rMEvt) override;
45 virtual bool MouseButtonUp(const MouseEvent& rMEvt) override;
46 virtual bool MouseButtonDown(const MouseEvent& rMEvt) override;
47 virtual bool RequestHelp(const HelpEvent& rHEvt) override;
48 virtual void ReceiveRequest(SfxRequest& rReq) override;
49 virtual void DoubleClick(const MouseEvent& rMEvt) override;
51 virtual void Activate() override; ///< activates the function
52 virtual void Deactivate() override; ///< deactivates the function
54 void SetInEditMode(const MouseEvent& rMEvt, bool bQuickDrag);
55 void DeleteDefaultText();
56 SdrTextObj* GetTextObj() { return mxTextObj.get(); }
58 virtual SdrObjectUniquePtr CreateDefaultObject(const sal_uInt16 nID, const ::tools::Rectangle& rRectangle) override;
60 /** is called when the current function should be aborted. <p>
61 This is used when a function gets a KEY_ESCAPE but can also
62 be called directly.
64 @returns true if a active function was aborted
66 virtual bool cancel() override;
68 static void ChangeFontSize( bool, OutlinerView*, const FontList*, ::sd::View* );
70 void InvalidateBindings();
73 protected:
74 FuText (ViewShell* pViewSh,
75 ::sd::Window* pWin,
76 ::sd::View* pView,
77 SdDrawDocument* pDoc,
78 SfxRequest& rReq);
80 private:
81 virtual void disposing() override;
83 ::tools::WeakReference<SdrTextObj>
84 mxTextObj;
85 bool bFirstObjCreated;
86 bool bJustEndedEdit;
88 SfxRequest& rRequest;
90 void ImpSetAttributesForNewTextObject(SdrTextObj* pTxtObj);
91 void ImpSetAttributesFitToSize(SdrTextObj* pTxtObj);
92 void ImpSetAttributesFitToSizeVertical(SdrTextObj* pTxtObj);
93 void ImpSetAttributesFitCommon(SdrTextObj* pTxtObj);
96 } // end of namespace sd
98 #endif
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */