LibreOffice Module sd (master) 1
annotationwindow.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/weld.hxx>
23#include <tools/long.hxx>
24#include <svx/weldeditview.hxx>
25
26namespace com::sun::star::office { class XAnnotation; }
27
28class OutlinerView;
29class Outliner;
30class SvxLanguageItem;
31class SdDrawDocument;
32
33namespace sd {
34
35class AnnotationManagerImpl;
36class DrawDocShell;
37class TextApiObject;
38
39class AnnotationWindow;
40
42{
43private:
45
46public:
48
49 virtual EditView* GetEditView() const override;
50
51 virtual EditEngine* GetEditEngine() const override;
52
53 virtual void EditViewScrollStateChange() override;
54
55 void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
56
57 virtual void Paint(vcl::RenderContext& rRenderContext, const ::tools::Rectangle& rRect) override;
58 virtual bool KeyInput(const KeyEvent& rKeyEvt) override;
59 virtual bool Command(const CommandEvent& rCEvt) override;
60};
61
63{
64private:
65 std::unique_ptr<weld::Builder> mxBuilder;
66 std::unique_ptr<weld::Popover> mxPopover;
67 std::unique_ptr<weld::Widget> mxContainer;
68
71
74
75 css::uno::Reference< css::office::XAnnotation > mxAnnotation;
76
77public:
81
82private:
84
85 std::unique_ptr<OutlinerView> mpOutlinerView;
86 std::unique_ptr<::Outliner> mpOutliner;
87
88 std::unique_ptr<weld::ScrolledWindow> mxVScrollbar;
89 std::unique_ptr<WeldEditView> mxTextControl;
90 std::unique_ptr<weld::CustomWeld> mxTextControlWin;
91 std::unique_ptr<weld::Label> mxMeta;
92 std::unique_ptr<weld::MenuButton> mxMenuButton;
93
94 DECL_LINK(ScrollHdl, weld::ScrolledWindow&, void);
95 DECL_LINK(MenuItemSelectedHdl, const OUString&, void);
96
97 void FillMenuButton();
98 void InitControls();
99
100 void SetMapMode(const MapMode& rNewMapMode);
101 void setAnnotation(const css::uno::Reference<css::office::XAnnotation>& xAnnotation);
102
103 static sal_Int32 GetPrefScrollbarWidth() { return 16; }
104public:
105 AnnotationWindow(weld::Window* pParent, const ::tools::Rectangle& rRect, DrawDocShell* pDocShell,
106 const css::uno::Reference<css::office::XAnnotation>& xAnnotation);
107
108 void connect_closed(const Link<weld::Popover&, void>& rLink) { mxPopover->connect_closed(rLink); }
109
110 void DoResize();
111 void ResizeIfNecessary(::tools::Long aOldHeight, ::tools::Long aNewHeight);
112 void SetScrollbar();
113 void StartEdit();
114
115 const css::uno::Reference<css::office::XAnnotation>& getAnnotation() const { return mxAnnotation; }
116
117 void SaveToDocument();
118
120
122
123 void SetLanguage(const SvxLanguageItem &aNewItem);
124
125 void Rescale();
126
127 void ToggleInsMode();
128
129 bool IsProtected() const { return mbProtected; }
130
134
135 void SetColor();
136};
137
138TextApiObject* getTextApiObject( const css::uno::Reference< css::office::XAnnotation >& xAnnotation );
139
140
141} // namespace sd
142
143/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void Paint(vcl::RenderContext &rRenderContext, const ::tools::Rectangle &rRect) override
virtual EditEngine * GetEditEngine() const override
virtual bool KeyInput(const KeyEvent &rKeyEvt) override
AnnotationWindow & mrContents
virtual EditView * GetEditView() const override
AnnotationTextWindow(AnnotationWindow &rContents)
virtual void EditViewScrollStateChange() override
void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
virtual bool Command(const CommandEvent &rCEvt) override
::tools::Long GetPostItTextHeight()
std::unique_ptr< weld::ScrolledWindow > mxVScrollbar
DECL_LINK(ScrollHdl, weld::ScrolledWindow &, void)
OutlinerView * GetOutlinerView()
DrawDocShell * DocShell()
const css::uno::Reference< css::office::XAnnotation > & getAnnotation() const
css::uno::Reference< css::office::XAnnotation > mxAnnotation
std::unique_ptr< weld::Widget > mxContainer
AnnotationWindow(weld::Window *pParent, const ::tools::Rectangle &rRect, DrawDocShell *pDocShell, const css::uno::Reference< css::office::XAnnotation > &xAnnotation)
std::unique_ptr< OutlinerView > mpOutlinerView
SdDrawDocument * mpDoc
std::unique_ptr<::Outliner > mpOutliner
std::unique_ptr< weld::Label > mxMeta
std::unique_ptr< WeldEditView > mxTextControl
DECL_LINK(MenuItemSelectedHdl, const OUString &, void)
void connect_closed(const Link< weld::Popover &, void > &rLink)
DrawDocShell * mpDocShell
::Outliner * GetOutliner()
std::unique_ptr< weld::Builder > mxBuilder
std::unique_ptr< weld::Popover > mxPopover
std::unique_ptr< weld::MenuButton > mxMenuButton
std::unique_ptr< weld::CustomWeld > mxTextControlWin
static sal_Int32 GetPrefScrollbarWidth()
void SetMapMode(const MapMode &rNewMapMode)
void ResizeIfNecessary(::tools::Long aOldHeight, ::tools::Long aNewHeight)
void setAnnotation(const css::uno::Reference< css::office::XAnnotation > &xAnnotation)
void SetLanguage(const SvxLanguageItem &aNewItem)
TextApiObject * getTextApiObject(const Reference< XAnnotation > &xAnnotation)
long Long