LibreOffice Module basctl (master) 1
dlged.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 <com/sun/star/awt/XControlContainer.hpp>
23#include <com/sun/star/container/XNameContainer.hpp>
24#include <com/sun/star/datatransfer/DataFlavor.hpp>
25#include <com/sun/star/frame/XModel.hpp>
26#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
27#include <o3tl/deleter.hxx>
29#include <svl/hint.hxx>
30#include <svx/svdobjkind.hxx>
31#include <tools/gen.hxx>
32#include <vcl/timer.hxx>
33#include <vcl/idle.hxx>
34#include <vcl/vclptr.hxx>
35#include <vcl/window.hxx>
36
37#include <memory>
38
39class ScrollAdaptor;
40class Printer;
41class KeyEvent;
42class MouseEvent;
43class Timer;
44namespace vcl { class Window; }
45
46namespace basctl
47{
48
49class DialogWindowLayout;
50
51constexpr auto DLGED_PAGE_WIDTH_MIN = 1280;
52constexpr auto DLGED_PAGE_HEIGHT_MIN = 1024;
53
54// DlgEdHint
55
56
57class DlgEdObj;
58
59class DlgEdHint: public SfxHint
60{
61public:
62 enum Kind {
68 };
69
70private:
73
74public:
76 DlgEdHint (Kind, DlgEdObj* pObj);
77 virtual ~DlgEdHint() override;
78
79 Kind GetKind() const { return eKind; }
80 DlgEdObj* GetObject() const { return pDlgEdObj; }
81};
82
83
84// DlgEditor
85
86
87class DlgEdModel;
88class DlgEdPage;
89class DlgEdView;
90class DlgEdForm;
91class DlgEdFactory;
92class DlgEdFunc;
93
95{
96public:
97 enum Mode {
102 };
103
104private:
105 DECL_LINK(MarkTimeout, Timer *, void);
106
107 static void Print( Printer* pPrinter, const OUString& rTitle );
108
109private:
112 std::unique_ptr<DlgEdModel> pDlgEdModel; // never nullptr
113 DlgEdPage* pDlgEdPage; // never nullptr
114 std::unique_ptr<DlgEdView> pDlgEdView; // never nullptr
116 css::uno::Reference< css::container::XNameContainer > m_xUnoControlDialogModel;
117 css::uno::Reference< css::awt::XControlContainer > m_xControlContainer;
118 css::uno::Sequence< css::datatransfer::DataFlavor > m_ClipboardDataFlavors;
119 css::uno::Sequence< css::datatransfer::DataFlavor > m_ClipboardDataFlavorsResource;
120 css::uno::Reference< css::util::XNumberFormatsSupplier > m_xSupplier;
121 std::unique_ptr<DlgEdFactory, o3tl::default_delete<DlgEdFactory>> pObjFac; // never nullptr
122 vcl::Window& rWindow; // DialogWindow
123 std::unique_ptr<DlgEdFunc> pFunc;
133 css::uno::Reference< css::frame::XModel > m_xDocument;
134
135public:
136 DlgEditor (
138 css::uno::Reference<css::frame::XModel> const& xModel,
139 css::uno::Reference<css::container::XNameContainer> const & xDialogModel
140 );
141 virtual ~DlgEditor() override;
142
143 vcl::Window& GetWindow() const { return rWindow; }
144
149 css::uno::Reference< css::awt::XControlContainer > const &
151
153 void InitScrollBars();
154 ScrollAdaptor* GetHScroll() const { return pHScroll; }
155 ScrollAdaptor* GetVScroll() const { return pVScroll; }
156 void DoScroll();
157 void UpdateScrollBars();
158
159 void SetDialog (const css::uno::Reference<css::container::XNameContainer>& xUnoControlDialogModel);
160 void ResetDialog ();
161 const css::uno::Reference< css::container::XNameContainer >& GetDialog() const
163
164 css::uno::Reference< css::util::XNumberFormatsSupplier > const & GetNumberFormatsSupplier();
165
166 DlgEdModel& GetModel() const { return *pDlgEdModel; }
167 DlgEdView& GetView() const { return *pDlgEdView; }
168 DlgEdPage& GetPage() const { return *pDlgEdPage; }
169
170 void ShowDialog();
171
172 bool UnmarkDialog();
173 bool RemarkDialog();
174
176
177 bool IsModified () const;
178 void ClearModifyFlag();
179
180 void MouseButtonDown( const MouseEvent& rMEvt );
181 void MouseButtonUp( const MouseEvent& rMEvt );
182 void MouseMove( const MouseEvent& rMEvt );
183 void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect);
184 bool KeyInput( const KeyEvent& rKEvt );
185
186 void SetMode (Mode eMode);
187 void SetInsertObj(SdrObjKind eObj);
188 void CreateDefaultObject();
189 Mode GetMode() const { return eMode; }
190 bool IsCreateOK() const { return bCreateOK; }
191
192 void Cut();
193 void Copy();
194 void Paste();
195 void Delete();
196 bool IsPasteAllowed();
197
198 void ShowProperties();
200
201 static void printPage( sal_Int32 nPage, Printer* pPrinter, const OUString& );
202
203 bool AdjustPageSize();
204
205 bool isInPaint() const { return mnPaintGuard > 0; }
206};
207
208} // namespace basctl
209
210/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
DlgEdObj * pDlgEdObj
Definition: dlged.hxx:72
virtual ~DlgEdHint() override
Definition: dlged.cxx:80
Kind GetKind() const
Definition: dlged.hxx:79
DlgEdHint(Kind)
Definition: dlged.cxx:68
DlgEdObj * GetObject() const
Definition: dlged.hxx:80
bool bDialogModelChanged
Definition: dlged.hxx:130
bool RemarkDialog()
Definition: dlged.cxx:162
const css::uno::Reference< css::container::XNameContainer > & GetDialog() const
Definition: dlged.hxx:161
ScrollAdaptor * GetVScroll() const
Definition: dlged.hxx:155
DECL_LINK(MarkTimeout, Timer *, void)
css::uno::Reference< css::container::XNameContainer > m_xUnoControlDialogModel
Definition: dlged.hxx:116
void SetDialog(const css::uno::Reference< css::container::XNameContainer > &xUnoControlDialogModel)
Definition: dlged.cxx:337
void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
Definition: dlged.cxx:465
void DoScroll()
Definition: dlged.cxx:286
ScrollAdaptor * GetHScroll() const
Definition: dlged.hxx:154
DlgEditor(vcl::Window &, DialogWindowLayout &, css::uno::Reference< css::frame::XModel > const &xModel, css::uno::Reference< css::container::XNameContainer > const &xDialogModel)
Definition: dlged.cxx:176
static void Print(Printer *pPrinter, const OUString &rTitle)
Definition: dlged.cxx:1134
SdrObjKind eActObj
Definition: dlged.hxx:126
void ClearModifyFlag()
Definition: dlged.cxx:1072
static void printPage(sal_Int32 nPage, Printer *pPrinter, const OUString &)
Definition: dlged.cxx:1127
DialogWindowLayout & rLayout
Definition: dlged.hxx:124
bool AdjustPageSize()
Definition: dlged.cxx:1187
void SetDialogModelChanged()
Definition: dlged.hxx:175
bool IsCreateOK() const
Definition: dlged.hxx:190
css::uno::Reference< css::awt::XControlContainer > m_xControlContainer
Definition: dlged.hxx:117
void SetInsertObj(SdrObjKind eObj)
Definition: dlged.cxx:598
VclPtr< ScrollAdaptor > pHScroll
Definition: dlged.hxx:110
css::uno::Reference< css::util::XNumberFormatsSupplier > m_xSupplier
Definition: dlged.hxx:120
tools::Long mnPaintGuard
Definition: dlged.hxx:132
bool KeyInput(const KeyEvent &rKEvt)
Definition: dlged.cxx:459
std::unique_ptr< DlgEdFactory, o3tl::default_delete< DlgEdFactory > > pObjFac
Definition: dlged.hxx:121
void UpdateScrollBars()
Definition: dlged.cxx:324
css::uno::Reference< css::awt::XControlContainer > const & GetWindowControlContainer()
returns the control container associated with our window
Definition: dlged.cxx:247
DlgEdModel & GetModel() const
Definition: dlged.hxx:166
bool IsModified() const
Definition: dlged.cxx:1066
void ResetDialog()
Definition: dlged.cxx:402
void MouseButtonUp(const MouseEvent &rMEvt)
Definition: dlged.cxx:444
VclPtr< ScrollAdaptor > pVScroll
Definition: dlged.hxx:111
void SetScrollBars(ScrollAdaptor *pHScroll, ScrollAdaptor *pVScroll)
Definition: dlged.cxx:254
DlgEdView & GetView() const
Definition: dlged.hxx:167
vcl::Window & GetWindow() const
Definition: dlged.hxx:143
void ShowProperties()
Definition: dlged.cxx:1054
void InitScrollBars()
Definition: dlged.cxx:262
rtl::Reference< DlgEdForm > pDlgEdForm
Definition: dlged.hxx:115
DlgEdPage & GetPage() const
Definition: dlged.hxx:168
css::uno::Sequence< css::datatransfer::DataFlavor > m_ClipboardDataFlavors
Definition: dlged.hxx:118
css::uno::Reference< css::util::XNumberFormatsSupplier > const & GetNumberFormatsSupplier()
Definition: dlged.cxx:420
bool isInPaint() const
Definition: dlged.hxx:205
Mode GetMode() const
Definition: dlged.hxx:189
void UpdatePropertyBrowserDelayed()
Definition: dlged.cxx:1060
std::unique_ptr< DlgEdFunc > pFunc
Definition: dlged.hxx:123
bool UnmarkDialog()
Definition: dlged.cxx:148
void SetMode(Mode eMode)
Definition: dlged.cxx:576
DlgEdPage * pDlgEdPage
Definition: dlged.hxx:113
tools::Rectangle aPaintRect
Definition: dlged.hxx:129
css::uno::Sequence< css::datatransfer::DataFlavor > m_ClipboardDataFlavorsResource
Definition: dlged.hxx:119
css::uno::Reference< css::frame::XModel > m_xDocument
Definition: dlged.hxx:133
void MouseButtonDown(const MouseEvent &rMEvt)
Definition: dlged.cxx:437
void CreateDefaultObject()
Definition: dlged.cxx:605
void ShowDialog()
Definition: dlged.cxx:88
vcl::Window & rWindow
Definition: dlged.hxx:122
std::unique_ptr< DlgEdModel > pDlgEdModel
Definition: dlged.hxx:112
virtual ~DlgEditor() override
Definition: dlged.cxx:240
void MouseMove(const MouseEvent &rMEvt)
Definition: dlged.cxx:453
std::unique_ptr< DlgEdView > pDlgEdView
Definition: dlged.hxx:114
bool IsPasteAllowed()
Definition: dlged.cxx:1035
constexpr auto DLGED_PAGE_WIDTH_MIN
Definition: dlged.hxx:51
constexpr auto DLGED_PAGE_HEIGHT_MIN
Definition: dlged.hxx:52
long Long
Mode
SdrObjKind