From 83b6adcd0daf935dcf9d52b4d1b791e79e274dcf Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Thu, 18 Apr 2024 14:54:52 +0900 Subject: annot: added Annotation impl. to svx, moved some thing from sd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is an attempt to move the sd::Annotation to the common code in the svx module. This will need to be done in multiple steps so the first one is to introduce sdr::annotation::Annotation class in svx module, which is derived by sd::Annotation. Non-problematic functionality and members are also moved to the svx Annotation. Change-Id: Id20466b3780514ab63a9df8923b879098870ebb6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166492 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit a938ed2be520426ce7949c4fd30a6e7e31d7c279) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168419 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna --- include/svx/annotation/Annotation.hxx | 57 +++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 include/svx/annotation/Annotation.hxx (limited to 'include') diff --git a/include/svx/annotation/Annotation.hxx b/include/svx/annotation/Annotation.hxx new file mode 100644 index 000000000000..13881a58d070 --- /dev/null +++ b/include/svx/annotation/Annotation.hxx @@ -0,0 +1,57 @@ +/* -*- 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 +#include +#include + +#include +#include + +namespace sdr::annotation +{ +class SVXCORE_DLLPUBLIC Annotation +{ +private: + static sal_uInt32 m_nLastId; + static sal_uInt32 nextID() { return m_nLastId++; } + +protected: + SdrPage* mpSdrPage; + sal_uInt32 m_nId; + + css::geometry::RealPoint2D m_Position; + css::geometry::RealSize2D m_Size; + OUString m_Author; + OUString m_Initials; + css::util::DateTime m_DateTime; + bool m_bIsFreeText = false; + +public: + Annotation(SdrPage* pPage) + : mpSdrPage(pPage) + , m_nId(nextID()) + { + } + + SdrModel* GetModel() + { + return mpSdrPage != nullptr ? &mpSdrPage->getSdrModelFromSdrPage() : nullptr; + } + + sal_uInt32 GetId() const { return m_nId; } +}; + +//typedef std::vector> AnnotationVector; + +} // namespace sdr::annotation + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit