1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dlged.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _BASCTL_DLGED_HXX
32 #define _BASCTL_DLGED_HXX
34 #include <com/sun/star/container/XNameContainer.hpp>
35 #include <com/sun/star/awt/XControlContainer.hpp>
36 #include <com/sun/star/datatransfer/DataFlavor.hpp>
37 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
38 #include <com/sun/star/frame/XModel.hpp>
39 #include <tools/link.hxx>
40 #include <tools/gen.hxx>
41 #include <vcl/timer.hxx>
42 #include <svtools/hint.hxx>
43 #include <svtools/brdcst.hxx>
45 #define DLGED_PAGE_WIDTH_MIN 1280
46 #define DLGED_PAGE_HEIGHT_MIN 1024
49 //============================================================================
51 //============================================================================
56 DLGED_HINT_WINDOWSCROLLED
,
57 DLGED_HINT_LAYERCHANGED
,
58 DLGED_HINT_OBJORDERCHANGED
,
59 DLGED_HINT_SELECTIONCHANGED
64 class DlgEdHint
: public SfxHint
67 DlgEdHintKind eHintKind
;
72 DlgEdHint( DlgEdHintKind eHint
);
73 DlgEdHint( DlgEdHintKind eHint
, DlgEdObj
* pObj
);
76 DlgEdHintKind
GetKind() const { return eHintKind
; }
77 DlgEdObj
* GetObject() const { return pDlgEdObj
; }
81 //============================================================================
83 //============================================================================
85 enum DlgEdMode
{ DLGED_INSERT
, DLGED_SELECT
, DLGED_TEST
, DLGED_READONLY
};
100 class DlgEditor
: public SfxBroadcaster
103 DECL_LINK( PaintTimeout
, Timer
* );
104 DECL_LINK( MarkTimeout
, Timer
* );
109 DlgEdModel
* pDlgEdModel
;
110 DlgEdPage
* pDlgEdPage
;
111 DlgEdView
* pDlgEdView
;
112 DlgEdForm
* pDlgEdForm
;
113 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameContainer
> m_xUnoControlDialogModel
;
114 ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControlContainer
> m_xControlContainer
;
115 ::com::sun::star::uno::Sequence
< ::com::sun::star::datatransfer::DataFlavor
> m_ClipboardDataFlavors
;
116 ::com::sun::star::uno::Sequence
< ::com::sun::star::datatransfer::DataFlavor
> m_ClipboardDataFlavorsResource
;
117 ::com::sun::star::uno::Reference
< ::com::sun::star::util::XNumberFormatsSupplier
> m_xSupplier
;
118 DlgEdFactory
* pObjFac
;
129 Rectangle aPaintRect
;
130 BOOL bDialogModelChanged
;
133 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
> m_xDocument
;
135 DlgEditor(); // not implemented
137 DlgEditor( const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
>& xModel
);
140 void SetWindow( Window
* pWindow
);
141 Window
* GetWindow() const { return pWindow
; }
143 /** returns the control container associated with our window
147 ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControlContainer
>
148 GetWindowControlContainer();
150 void SetDlgEdForm( DlgEdForm
* pForm
) { pDlgEdForm
= pForm
; }
151 DlgEdForm
* GetDlgEdForm() const { return pDlgEdForm
; }
153 void SetScrollBars( ScrollBar
* pHScroll
, ScrollBar
* pVScroll
);
154 void InitScrollBars();
155 ScrollBar
* GetHScroll() const { return pHScroll
; }
156 ScrollBar
* GetVScroll() const { return pVScroll
; }
157 void DoScroll( ScrollBar
* pActScroll
);
158 void UpdateScrollBars();
160 void SetDialog( ::com::sun::star::uno::Reference
<
161 ::com::sun::star::container::XNameContainer
> xUnoControlDialogModel
);
162 void ResetDialog( void );
163 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameContainer
> GetDialog() const
164 {return m_xUnoControlDialogModel
;}
166 ::com::sun::star::uno::Reference
< ::com::sun::star::util::XNumberFormatsSupplier
> const & GetNumberFormatsSupplier();
168 DlgEdModel
* GetModel() const { return pDlgEdModel
; }
169 DlgEdView
* GetView() const { return pDlgEdView
; }
170 DlgEdPage
* GetPage() const { return pDlgEdPage
; }
177 void SetDialogModelChanged( BOOL bChanged
= TRUE
) { bDialogModelChanged
= bChanged
; }
178 BOOL
IsDialogModelChanged() const { return bDialogModelChanged
; }
180 BOOL
IsModified() const;
181 void ClearModifyFlag();
183 void MouseButtonDown( const MouseEvent
& rMEvt
);
184 void MouseButtonUp( const MouseEvent
& rMEvt
);
185 void MouseMove( const MouseEvent
& rMEvt
);
186 void Paint( const Rectangle
& rRect
);
187 BOOL
KeyInput( const KeyEvent
& rKEvt
);
189 void SetMode( DlgEdMode eMode
);
190 void SetInsertObj( USHORT eObj
);
191 USHORT
GetInsertObj() const;
192 void CreateDefaultObject();
193 DlgEdMode
GetMode() const { return eMode
; }
194 BOOL
IsCreateOK() const { return bCreateOK
; }
200 BOOL
IsPasteAllowed();
202 void ShowProperties();
203 void UpdatePropertyBrowserDelayed();
205 void PrintData( Printer
*, const String
& rTitle
); // not working yet
207 bool AdjustPageSize();
209 bool isInPaint() const { return mnPaintGuard
> 0; }
212 #endif //_BASCTL_DLGED_HXX