diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2024-04-18 14:54:52 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2024-04-25 07:17:51 +0200 |
commit | a938ed2be520426ce7949c4fd30a6e7e31d7c279 (patch) | |
tree | a5e1ec446830a11323cdfdfcccc05e29c97aa88a /include/svx | |
parent | b2b84dfa1d4f5da32f3335c59d618d385173a170 (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>
Diffstat (limited to 'include/svx')
-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: */ |