bump product version to 6.4.0.3
[LibreOffice.git] / sd / source / ui / annotations / annotationtag.hxx
blob65dabdc50bbc35f1a31d7f660effc08b1e388073
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 Command( const CommandEvent& rCEvt ) override;
48 // callbacks from sdr view
49 virtual sal_Int32 GetMarkablePointCount() const override;
50 virtual sal_Int32 GetMarkedPointCount() const override;
51 virtual bool MarkPoint(SdrHdl& rHdl, bool bUnmark) override;
52 virtual void CheckPossibilities() override;
53 virtual bool MarkPoints(const ::tools::Rectangle* pRect, bool bUnmark) override;
55 void Move( int nDX, int nDY );
56 bool OnMove( const KeyEvent& rKEvt );
58 BitmapEx CreateAnnotationBitmap(bool);
60 const css::uno::Reference< css::office::XAnnotation >& GetAnnotation() const { return mxAnnotation; }
62 void OpenPopup( bool bEdit );
63 void ClosePopup();
65 private:
66 virtual void addCustomHandles( SdrHdlList& rHandlerList ) override;
67 virtual bool getContext( SdrViewContext& rContext ) override;
68 virtual void disposing() override;
69 virtual void select() override;
70 virtual void deselect() override;
72 DECL_LINK( WindowEventHandler, VclWindowEvent&, void );
73 DECL_LINK( ClosePopupHdl, void*, void );
75 AnnotationManagerImpl& mrManager;
76 css::uno::Reference< css::office::XAnnotation > mxAnnotation;
77 VclPtr<AnnotationWindow> mpAnnotationWindow;
78 Color const maColor;
79 int const mnIndex;
80 const vcl::Font& mrFont;
81 Size maSize;
82 ImplSVEvent * mnClosePopupEvent;
83 VclPtr<vcl::Window> mpListenWindow;
84 Point maMouseDownPos;
87 } // end of namespace sd
89 #endif // INCLUDED_SD_SOURCE_UI_ANNOTATIONS_ANNOTATIONTAG_HXX
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */