fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / basctl / source / inc / dlged.hxx
blob8c7b302170e775949bd0ade7653da4227cb457f9
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef BASCTL_DLGED_HXX
21 #define BASCTL_DLGED_HXX
23 #include <com/sun/star/awt/XControlContainer.hpp>
24 #include <com/sun/star/container/XNameContainer.hpp>
25 #include <com/sun/star/datatransfer/DataFlavor.hpp>
26 #include <com/sun/star/frame/XModel.hpp>
27 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
28 #include <svl/brdcst.hxx>
29 #include <svl/hint.hxx>
30 #include <tools/gen.hxx>
31 #include <vcl/timer.hxx>
33 #include <boost/scoped_ptr.hpp>
35 class ScrollBar;
36 class Printer;
37 class KeyEvent;
38 class MouseEvent;
39 class Timer;
40 class Window;
42 namespace basctl
45 class DialogWindowLayout;
47 #define DLGED_PAGE_WIDTH_MIN 1280
48 #define DLGED_PAGE_HEIGHT_MIN 1024
50 //============================================================================
51 // DlgEdHint
52 //============================================================================
54 class DlgEdObj;
56 class DlgEdHint: public SfxHint
58 public:
59 enum Kind {
60 UNKNOWN,
61 WINDOWSCROLLED,
62 LAYERCHANGED,
63 OBJORDERCHANGED,
64 SELECTIONCHANGED,
67 private:
68 Kind eKind;
69 DlgEdObj* pDlgEdObj;
71 public:
72 TYPEINFO();
73 DlgEdHint (Kind);
74 DlgEdHint (Kind, DlgEdObj* pObj);
75 virtual ~DlgEdHint();
77 Kind GetKind() const { return eKind; }
78 DlgEdObj* GetObject() const { return pDlgEdObj; }
82 //============================================================================
83 // DlgEditor
84 //============================================================================
86 class DlgEdModel;
87 class DlgEdPage;
88 class DlgEdView;
89 class DlgEdForm;
90 class DlgEdFactory;
91 class DlgEdFunc;
93 class DlgEditor: public SfxBroadcaster
95 public:
96 enum Mode {
97 INSERT,
98 SELECT,
99 TEST,
100 READONLY,
103 private:
104 DECL_LINK(PaintTimeout, void *);
105 DECL_LINK(MarkTimeout, void *);
107 void Print( Printer* pPrinter, const OUString& rTitle );
109 private:
110 ScrollBar* pHScroll;
111 ScrollBar* pVScroll;
112 boost::scoped_ptr<DlgEdModel> pDlgEdModel; // never nullptr
113 DlgEdPage* pDlgEdPage; // never nullptr
114 boost::scoped_ptr<DlgEdView> pDlgEdView; // never nullptr
115 DlgEdForm* pDlgEdForm; // never nullptr
116 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > m_xUnoControlDialogModel;
117 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > m_xControlContainer;
118 ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > m_ClipboardDataFlavors;
119 ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > m_ClipboardDataFlavorsResource;
120 ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > m_xSupplier;
121 boost::scoped_ptr<DlgEdFactory> pObjFac; // never nullptr
122 Window& rWindow; // DialogWindow
123 boost::scoped_ptr<DlgEdFunc> pFunc;
124 DialogWindowLayout& rLayout;
125 Mode eMode;
126 sal_uInt16 eActObj;
127 bool bFirstDraw;
128 Size aGridSize;
129 bool bGridVisible;
130 bool bGridSnap;
131 bool bCreateOK;
132 Timer aPaintTimer;
133 Rectangle aPaintRect;
134 bool bDialogModelChanged;
135 Timer aMarkTimer;
136 long mnPaintGuard;
137 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xDocument;
139 public:
140 DlgEditor (
141 Window&, DialogWindowLayout&,
142 com::sun::star::uno::Reference<com::sun::star::frame::XModel> const& xModel,
143 com::sun::star::uno::Reference<com::sun::star::container::XNameContainer> xDialogModel
145 ~DlgEditor();
147 Window& GetWindow() const { return rWindow; }
149 /** returns the control container associated with our window
150 @see GetWindow
151 @see SetWindow
153 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >
154 GetWindowControlContainer();
156 void SetScrollBars( ScrollBar* pHScroll, ScrollBar* pVScroll );
157 void InitScrollBars();
158 ScrollBar* GetHScroll() const { return pHScroll; }
159 ScrollBar* GetVScroll() const { return pVScroll; }
160 void DoScroll( ScrollBar* pActScroll );
161 void UpdateScrollBars();
163 void SetDialog (com::sun::star::uno::Reference<com::sun::star::container::XNameContainer> xUnoControlDialogModel);
164 void ResetDialog ();
165 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > GetDialog() const
166 {return m_xUnoControlDialogModel;}
168 ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > const & GetNumberFormatsSupplier();
170 DlgEdModel& GetModel() const { return *pDlgEdModel; }
171 DlgEdView& GetView() const { return *pDlgEdView; }
172 DlgEdPage& GetPage() const { return *pDlgEdPage; }
174 void ShowDialog();
176 bool UnmarkDialog();
177 bool RemarkDialog();
179 void SetDialogModelChanged (bool bChanged = true) { bDialogModelChanged = bChanged; }
180 bool IsDialogModelChanged () const { return bDialogModelChanged; }
182 bool IsModified () const;
183 void ClearModifyFlag();
185 void MouseButtonDown( const MouseEvent& rMEvt );
186 void MouseButtonUp( const MouseEvent& rMEvt );
187 void MouseMove( const MouseEvent& rMEvt );
188 void Paint( const Rectangle& rRect );
189 bool KeyInput( const KeyEvent& rKEvt );
191 void SetMode (Mode eMode);
192 void SetInsertObj( sal_uInt16 eObj );
193 sal_uInt16 GetInsertObj() const;
194 void CreateDefaultObject();
195 Mode GetMode() const { return eMode; }
196 bool IsCreateOK() const { return bCreateOK; }
198 void Cut();
199 void Copy();
200 void Paste();
201 void Delete();
202 bool IsPasteAllowed();
204 void ShowProperties();
205 void UpdatePropertyBrowserDelayed();
207 sal_Int32 countPages( Printer* pPrinter );
208 void printPage( sal_Int32 nPage, Printer* pPrinter, const OUString& );
210 bool AdjustPageSize();
212 bool isInPaint() const { return mnPaintGuard > 0; }
215 } // namespace basctl
217 #endif // BASCTL_DLGED_HXX
219 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */