diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2024-04-18 14:54:52 +0900 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2024-06-10 08:51:58 +0200 |
commit | 83b6adcd0daf935dcf9d52b4d1b791e79e274dcf (patch) | |
tree | f2d8172c60195b4e3aaadaeb869f93d01ecb4d28 /include | |
parent | 65fa3d18ce28c609ead1ac81c93d0fbb38ce9658 (diff) |
annot: added Annotation impl. to svx, moved some thing from sd
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 <quikee@gmail.com>
(cherry picked from commit a938ed2be520426ce7949c4fd30a6e7e31d7c279)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168419
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/svx/annotation/Annotation.hxx | 57 |
1 files changed, 57 insertions, 0 deletions
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 <com/sun/star/geometry/RealPoint2D.hpp> +#include <com/sun/star/geometry/RealSize2D.hpp> +#include <com/sun/star/util/DateTime.hpp> + +#include <svx/svdpage.hxx> +#include <svx/svxdllapi.h> + +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<rtl::Reference<Annotation>> AnnotationVector; + +} // namespace sdr::annotation + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |