bump product version to 5.0.4.1
[LibreOffice.git] / sd / source / ui / annotations / annotationtag.hxx
blob1158417c5e30a166524ef27cd4c37a321a12b40f
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 <com/sun/star/office/XAnnotation.hpp>
24 #include <basegfx/polygon/b2dpolypolygon.hxx>
25 #include <basegfx/polygon/b2dpolypolygontools.hxx>
26 #include "smarttag.hxx"
28 namespace sd {
30 class View;
31 class AnnotationManagerImpl;
32 class AnnotationWindow;
34 class AnnotationTag : public SmartTag
36 public:
37 AnnotationTag( AnnotationManagerImpl& rManager, ::sd::View& rView, const css::uno::Reference< css::office::XAnnotation >& xAnnotation, Color& rColor, int nIndex, const vcl::Font& rFont );
38 virtual ~AnnotationTag();
40 /// @return true if the SmartTag handled the event.
41 virtual bool MouseButtonDown( const MouseEvent&, SmartHdl& ) SAL_OVERRIDE;
43 /// @return true if the SmartTag consumes this event.
44 virtual bool KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
46 /// @return true if the SmartTag consumes this event.
47 virtual bool RequestHelp( const HelpEvent& rHEvt ) SAL_OVERRIDE;
49 /// @return true if the SmartTag consumes this event.
50 virtual bool Command( const CommandEvent& rCEvt ) SAL_OVERRIDE;
52 // callbacks from sdr view
53 virtual sal_uLong GetMarkablePointCount() const SAL_OVERRIDE;
54 virtual sal_uLong GetMarkedPointCount() const SAL_OVERRIDE;
55 virtual bool MarkPoint(SdrHdl& rHdl, bool bUnmark=false) SAL_OVERRIDE;
56 virtual void CheckPossibilities() SAL_OVERRIDE;
57 virtual bool MarkPoints(const Rectangle* pRect, bool bUnmark) SAL_OVERRIDE;
59 void Move( int nDX, int nDY );
60 bool OnMove( const KeyEvent& rKEvt );
62 BitmapEx CreateAnnotationBitmap(bool);
64 css::uno::Reference< css::office::XAnnotation > GetAnnotation() const { return mxAnnotation; }
66 void OpenPopup( bool bEdit );
67 void ClosePopup();
69 protected:
70 virtual void addCustomHandles( SdrHdlList& rHandlerList ) SAL_OVERRIDE;
71 virtual bool getContext( SdrViewContext& rContext ) SAL_OVERRIDE;
72 virtual void disposing() SAL_OVERRIDE;
73 virtual void select() SAL_OVERRIDE;
74 virtual void deselect() SAL_OVERRIDE;
76 DECL_LINK( WindowEventHandler, VclWindowEvent* );
77 DECL_LINK( ClosePopupHdl, void* );
79 private:
80 AnnotationManagerImpl& mrManager;
81 css::uno::Reference< css::office::XAnnotation > mxAnnotation;
82 VclPtr<AnnotationWindow> mpAnnotationWindow;
83 Color maColor;
84 int mnIndex;
85 const vcl::Font& mrFont;
86 Size maSize;
87 ImplSVEvent * mnClosePopupEvent;
88 VclPtr<vcl::Window> mpListenWindow;
89 Point maMouseDownPos;
92 } // end of namespace sd
94 #endif // INCLUDED_SD_SOURCE_UI_ANNOTATIONS_ANNOTATIONTAG_HXX
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */