bump product version to 6.3.0.0.beta1
[LibreOffice.git] / sd / source / ui / annotations / annotationtag.hxx
blob7a62b5b13a06a212e14b71c1d5d517d4a1110419
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_ANNOTATIONS_ANNOTATIONTAG_HXX
21 #define INCLUDED_SD_SOURCE_UI_ANNOTATIONS_ANNOTATIONTAG_HXX
23 #include <smarttag.hxx>
24 #include "annotationwindow.hxx"
26 namespace com { namespace sun { namespace star { namespace office { class XAnnotation; } } } }
28 namespace sd {
30 class View;
31 class AnnotationManagerImpl;
33 class AnnotationTag final : public SmartTag
35 public:
36 AnnotationTag( AnnotationManagerImpl& rManager, ::sd::View& rView, const css::uno::Reference< css::office::XAnnotation >& xAnnotation, Color const & rColor, int nIndex, const vcl::Font& rFont );
37 virtual ~AnnotationTag() override;
39 /// @return true if the SmartTag handled the event.
40 virtual bool MouseButtonDown( const MouseEvent&, SmartHdl& ) override;
42 /// @return true if the SmartTag consumes this event.
43 virtual bool KeyInput( const KeyEvent& rKEvt ) override;
45 /// @return true if the SmartTag consumes this event.
46 virtual bool RequestHelp( const HelpEvent& rHEvt ) override;
48 /// @return true if the SmartTag consumes this event.
49 virtual bool Command( const CommandEvent& rCEvt ) override;
51 // callbacks from sdr view
52 virtual sal_Int32 GetMarkablePointCount() const override;
53 virtual sal_Int32 GetMarkedPointCount() const override;
54 virtual bool MarkPoint(SdrHdl& rHdl, bool bUnmark) override;
55 virtual void CheckPossibilities() override;
56 virtual bool MarkPoints(const ::tools::Rectangle* pRect, bool bUnmark) override;
58 void Move( int nDX, int nDY );
59 bool OnMove( const KeyEvent& rKEvt );
61 BitmapEx CreateAnnotationBitmap(bool);
63 const css::uno::Reference< css::office::XAnnotation >& GetAnnotation() const { return mxAnnotation; }
65 void OpenPopup( bool bEdit );
66 void ClosePopup();
68 private:
69 virtual void addCustomHandles( SdrHdlList& rHandlerList ) override;
70 virtual bool getContext( SdrViewContext& rContext ) override;
71 virtual void disposing() override;
72 virtual void select() override;
73 virtual void deselect() override;
75 DECL_LINK( WindowEventHandler, VclWindowEvent&, void );
76 DECL_LINK( ClosePopupHdl, void*, void );
78 AnnotationManagerImpl& mrManager;
79 css::uno::Reference< css::office::XAnnotation > mxAnnotation;
80 VclPtr<AnnotationWindow> mpAnnotationWindow;
81 Color const maColor;
82 int const mnIndex;
83 const vcl::Font& mrFont;
84 Size maSize;
85 ImplSVEvent * mnClosePopupEvent;
86 VclPtr<vcl::Window> mpListenWindow;
87 Point maMouseDownPos;
90 } // end of namespace sd
92 #endif // INCLUDED_SD_SOURCE_UI_ANNOTATIONS_ANNOTATIONTAG_HXX
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */