Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef SD_FU_TEXT_HXX
30 : : #define SD_FU_TEXT_HXX
31 : :
32 : : #include <editeng/editdata.hxx>
33 : : #include "fuconstr.hxx"
34 : : #include <svx/svdotext.hxx>
35 : :
36 : : struct StyleRequestData;
37 : : class SdrTextObj;
38 : : class FontList;
39 : : class OutlinerView;
40 : :
41 : : namespace sd {
42 : :
43 : : /*************************************************************************
44 : : |*
45 : : |* Basisklasse fuer Textfunktionen
46 : : |*
47 : : \************************************************************************/
48 : :
49 [ # # ][ # # ]: 0 : class FuText
50 : : : public FuConstruct
51 : : {
52 : : public:
53 : : TYPEINFO();
54 : :
55 : : static FunctionReference Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq );
56 : : virtual void DoExecute( SfxRequest& rReq );
57 : :
58 : : virtual sal_Bool KeyInput(const KeyEvent& rKEvt);
59 : : virtual sal_Bool MouseMove(const MouseEvent& rMEvt);
60 : : virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
61 : : virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
62 : : virtual sal_Bool Command(const CommandEvent& rCEvt);
63 : : virtual sal_Bool RequestHelp(const HelpEvent& rHEvt);
64 : : virtual void ReceiveRequest(SfxRequest& rReq);
65 : : virtual void DoubleClick(const MouseEvent& rMEvt);
66 : :
67 : : virtual void Activate(); // Function aktivieren
68 : : virtual void Deactivate(); // Function deaktivieren
69 : :
70 : : void SetInEditMode(const MouseEvent& rMEvt, sal_Bool bQuickDrag);
71 : : sal_Bool DeleteDefaultText();
72 : 0 : SdrTextObj* GetTextObj() { return static_cast< SdrTextObj* >( mxTextObj.get() ); }
73 : :
74 : : virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle);
75 : :
76 : : /** is called when the currenct function should be aborted. <p>
77 : : This is used when a function gets a KEY_ESCAPE but can also
78 : : be called directly.
79 : :
80 : : @returns true if a active function was aborted
81 : : */
82 : : virtual bool cancel();
83 : :
84 : : static void ChangeFontSize( bool, OutlinerView*, const FontList*, ::sd::View* );
85 : :
86 : : protected:
87 : : FuText (ViewShell* pViewSh,
88 : : ::sd::Window* pWin,
89 : : ::sd::View* pView,
90 : : SdDrawDocument* pDoc,
91 : : SfxRequest& rReq);
92 : :
93 : : virtual void disposing();
94 : :
95 : : SdrObjectWeakRef mxTextObj;
96 : : Link aOldLink;
97 : : sal_Bool bFirstObjCreated;
98 : : bool bJustEndedEdit;
99 : :
100 : : SfxRequest& rRequest;
101 : :
102 : : private:
103 : : void ImpSetAttributesForNewTextObject(SdrTextObj* pTxtObj);
104 : : void ImpSetAttributesFitToSize(SdrTextObj* pTxtObj);
105 : : void ImpSetAttributesFitToSizeVertical(SdrTextObj* pTxtObj);
106 : : void ImpSetAttributesFitCommon(SdrTextObj* pTxtObj);
107 : : };
108 : :
109 : : } // end of namespace sd
110 : :
111 : : #endif
112 : :
113 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|