diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2024-06-07 12:15:28 +0900 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2024-06-18 11:19:46 +0200 |
commit | 0aae22f0a19064ba6b67b9008762f693967228a8 (patch) | |
tree | d56b4110c2ec0229ff26c314d398028f534339b3 /include | |
parent | d65acecc180c437f4c564fb5b3c4ad985986801c (diff) |
annot: make annotation pop-up window working again
The code to open AnnotatationWindow was removed in the previous
change as it needed to be changed to make it work with annotation
(sdr) object.
Change-Id: Ic75e4fca6b46359f29762bc4735a76204aeb90f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168651
Tested-by: Miklos Vajna <vmiklos@collabora.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/svx/annotation/IAnnotationPopup.hxx | 37 | ||||
-rw-r--r-- | include/svx/annotation/ObjectAnnotationData.hxx | 8 |
2 files changed, 45 insertions, 0 deletions
diff --git a/include/svx/annotation/IAnnotationPopup.hxx b/include/svx/annotation/IAnnotationPopup.hxx new file mode 100644 index 000000000000..8a705ef1e935 --- /dev/null +++ b/include/svx/annotation/IAnnotationPopup.hxx @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include <svx/svxdllapi.h> + +#include <svx/annotation/Annotation.hxx> + +namespace sdr::annotation +{ +class SVXCORE_DLLPUBLIC IAnnotationPopup +{ +protected: + rtl::Reference<sdr::annotation::Annotation> mxAnnotation; + +public: + IAnnotationPopup(rtl::Reference<sdr::annotation::Annotation> const& pAnnotation) + : mxAnnotation(pAnnotation) + { + } + + virtual ~IAnnotationPopup() {} + + virtual void openPopup() = 0; + virtual void closePopup() = 0; +}; + +} // end sdr::annotation + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/annotation/ObjectAnnotationData.hxx b/include/svx/annotation/ObjectAnnotationData.hxx index 44776638e64f..50a2f80c80ac 100644 --- a/include/svx/annotation/ObjectAnnotationData.hxx +++ b/include/svx/annotation/ObjectAnnotationData.hxx @@ -11,6 +11,7 @@ #include <svx/svxdllapi.h> #include <svx/annotation/Annotation.hxx> +#include <svx/annotation/IAnnotationPopup.hxx> namespace sdr::annotation { @@ -20,6 +21,13 @@ class ObjectAnnotationData public: bool mbIsAnnotation : 1 = false; rtl::Reference<sdr::annotation::Annotation> mxAnnotation; + std::unique_ptr<sdr::annotation::IAnnotationPopup> mpAnnotationPopup; + + void openPopup() + { + if (mbIsAnnotation && mpAnnotationPopup) + mpAnnotationPopup->openPopup(); + } }; } |