update credits
[LibreOffice.git] / sd / source / ui / annotations / annotationtag.hxx
blobe2a7f22f564e10d34b86dd7fec09fbf8c7c4d791
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 _SD_ANNOTATIONTAG_HXX_
21 #define _SD_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 Font& rFont );
38 virtual ~AnnotationTag();
40 /// @return true if the SmartTag handled the event.
41 virtual bool MouseButtonDown( const MouseEvent&, SmartHdl& );
43 /// @return true if the SmartTag consumes this event.
44 virtual bool KeyInput( const KeyEvent& rKEvt );
46 /// @return true if the SmartTag consumes this event.
47 virtual bool RequestHelp( const HelpEvent& rHEvt );
49 /// @return true if the SmartTag consumes this event.
50 virtual bool Command( const CommandEvent& rCEvt );
52 // callbacks from sdr view
53 virtual sal_uLong GetMarkablePointCount() const;
54 virtual sal_uLong GetMarkedPointCount() const;
55 virtual sal_Bool MarkPoint(SdrHdl& rHdl, sal_Bool bUnmark=sal_False);
56 virtual void CheckPossibilities();
57 virtual sal_Bool MarkPoints(const Rectangle* pRect, sal_Bool bUnmark);
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 );
71 virtual bool getContext( SdrViewContext& rContext );
72 virtual void disposing();
73 virtual void select();
74 virtual void deselect();
76 DECL_LINK( WindowEventHandler, VclWindowEvent* );
77 DECL_LINK( ClosePopupHdl, void* );
79 private:
80 AnnotationManagerImpl& mrManager;
81 css::uno::Reference< css::office::XAnnotation > mxAnnotation;
82 std::auto_ptr<AnnotationWindow> mpAnnotationWindow;
83 Color maColor;
84 int mnIndex;
85 const Font& mrFont;
86 Size maSize;
87 sal_uLong mnClosePopupEvent;
88 ::Window* mpListenWindow;
89 Point maMouseDownPos;
92 } // end of namespace sd
94 #endif // _SD_ANNOTATIONTAG_HXX_
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */