LibreOffice Module sd (master) 1
annotationtag.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <vcl/vclevent.hxx>
23
24#include <smarttag.hxx>
25#include "annotationwindow.hxx"
26
27namespace com::sun::star::office { class XAnnotation; }
28
29namespace sd {
30
31class View;
32class AnnotationManagerImpl;
33
34class AnnotationTag final : public SmartTag
35{
36public:
37 AnnotationTag( AnnotationManagerImpl& rManager, ::sd::View& rView, const css::uno::Reference< css::office::XAnnotation >& xAnnotation, Color const & rColor, int nIndex, const vcl::Font& rFont );
38 virtual ~AnnotationTag() override;
39
41 virtual bool MouseButtonDown( const MouseEvent&, SmartHdl& ) override;
42
44 virtual bool KeyInput( const KeyEvent& rKEvt ) override;
45
47 virtual bool Command( const CommandEvent& rCEvt ) override;
48
49 // callbacks from sdr view
50 virtual sal_Int32 GetMarkablePointCount() const override;
51 virtual sal_Int32 GetMarkedPointCount() const override;
52 virtual bool MarkPoint(SdrHdl& rHdl, bool bUnmark) override;
53 virtual void CheckPossibilities() override;
54 virtual bool MarkPoints(const ::tools::Rectangle* pRect, bool bUnmark) override;
55
56 void Move( int nDX, int nDY );
57 bool OnMove( const KeyEvent& rKEvt );
58
60
61 const css::uno::Reference< css::office::XAnnotation >& GetAnnotation() const { return mxAnnotation; }
62
63 void OpenPopup( bool bEdit );
64 void ClosePopup();
65
66private:
67 virtual void addCustomHandles( SdrHdlList& rHandlerList ) override;
68 virtual bool getContext( SdrViewContext& rContext ) override;
69 virtual void disposing() override;
70 virtual void select() override;
71 virtual void deselect() override;
72
73 DECL_LINK( WindowEventHandler, VclWindowEvent&, void );
74 DECL_LINK(PopupModeEndHdl, weld::Popover&, void);
75
77 css::uno::Reference< css::office::XAnnotation > mxAnnotation;
78 std::unique_ptr<AnnotationWindow> mpAnnotationWindow;
85};
86
87} // end of namespace sd
88
89/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void OpenPopup(bool bEdit)
BitmapEx CreateAnnotationBitmap(bool)
std::unique_ptr< AnnotationWindow > mpAnnotationWindow
virtual bool MarkPoints(const ::tools::Rectangle *pRect, bool bUnmark) override
DECL_LINK(WindowEventHandler, VclWindowEvent &, void)
virtual void addCustomHandles(SdrHdlList &rHandlerList) override
virtual void select() override
AnnotationManagerImpl & mrManager
virtual bool MouseButtonDown(const MouseEvent &, SmartHdl &) override
returns true if the AnnotationTag handled the event.
virtual bool getContext(SdrViewContext &rContext) override
VclPtr< vcl::Window > mpListenWindow
bool OnMove(const KeyEvent &rKEvt)
virtual bool Command(const CommandEvent &rCEvt) override
returns true if the SmartTag consumes this event.
const css::uno::Reference< css::office::XAnnotation > & GetAnnotation() const
virtual ~AnnotationTag() override
css::uno::Reference< css::office::XAnnotation > mxAnnotation
virtual void disposing() override
void Move(int nDX, int nDY)
AnnotationTag(AnnotationManagerImpl &rManager, ::sd::View &rView, const css::uno::Reference< css::office::XAnnotation > &xAnnotation, Color const &rColor, int nIndex, const vcl::Font &rFont)
virtual bool KeyInput(const KeyEvent &rKEvt) override
returns true if the SmartTag consumes this event.
const vcl::Font & mrFont
virtual void CheckPossibilities() override
virtual bool MarkPoint(SdrHdl &rHdl, bool bUnmark) override
DECL_LINK(PopupModeEndHdl, weld::Popover &, void)
virtual sal_Int32 GetMarkablePointCount() const override
virtual void deselect() override
virtual sal_Int32 GetMarkedPointCount() const override
a derivation from this handle is the visual representation for a smart tag.
Definition: smarttag.hxx:157
a smart tag represents a visual user interface element on the documents edit view that is not part of...
Definition: smarttag.hxx:44
sal_Int32 nIndex
SdrViewContext