2010-10-27 12:45:03 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2001-02-26 09:52:34 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-11 10:08:18 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2001-02-26 09:52:34 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2001-02-26 09:52:34 +00:00
|
|
|
*
|
2008-04-11 10:08:18 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2001-02-26 09:52:34 +00:00
|
|
|
*
|
2008-04-11 10:08:18 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2001-02-26 09:52:34 +00:00
|
|
|
*
|
2008-04-11 10:08:18 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2001-02-26 09:52:34 +00:00
|
|
|
*
|
2008-04-11 10:08:18 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2001-02-26 09:52:34 +00:00
|
|
|
*
|
2008-04-11 10:08:18 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2001-02-26 09:52:34 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _BASCTL_DLGED_HXX
|
|
|
|
#define _BASCTL_DLGED_HXX
|
|
|
|
|
2006-11-14 14:29:26 +00:00
|
|
|
#include <com/sun/star/awt/XControlContainer.hpp>
|
2011-11-06 21:21:30 -05:00
|
|
|
#include <com/sun/star/container/XNameContainer.hpp>
|
2001-04-10 14:18:14 +00:00
|
|
|
#include <com/sun/star/datatransfer/DataFlavor.hpp>
|
2010-10-06 10:16:13 +01:00
|
|
|
#include <com/sun/star/frame/XModel.hpp>
|
2011-11-06 21:21:30 -05:00
|
|
|
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
|
|
|
|
#include <svl/brdcst.hxx>
|
|
|
|
#include <svl/hint.hxx>
|
2004-01-06 16:14:57 +00:00
|
|
|
#include <tools/gen.hxx>
|
2003-03-26 11:51:00 +00:00
|
|
|
#include <vcl/timer.hxx>
|
|
|
|
|
2004-12-10 16:02:40 +00:00
|
|
|
#define DLGED_PAGE_WIDTH_MIN 1280
|
|
|
|
#define DLGED_PAGE_HEIGHT_MIN 1024
|
|
|
|
|
2003-03-26 11:51:00 +00:00
|
|
|
//============================================================================
|
|
|
|
// DlgEdHint
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
enum DlgEdHintKind
|
|
|
|
{
|
|
|
|
DLGED_HINT_UNKNOWN,
|
|
|
|
DLGED_HINT_WINDOWSCROLLED,
|
|
|
|
DLGED_HINT_LAYERCHANGED,
|
|
|
|
DLGED_HINT_OBJORDERCHANGED,
|
|
|
|
DLGED_HINT_SELECTIONCHANGED
|
|
|
|
};
|
|
|
|
|
|
|
|
class DlgEdObj;
|
|
|
|
|
|
|
|
class DlgEdHint: public SfxHint
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
DlgEdHintKind eHintKind;
|
|
|
|
DlgEdObj* pDlgEdObj;
|
|
|
|
|
|
|
|
public:
|
|
|
|
TYPEINFO();
|
|
|
|
DlgEdHint( DlgEdHintKind eHint );
|
|
|
|
DlgEdHint( DlgEdHintKind eHint, DlgEdObj* pObj );
|
|
|
|
virtual ~DlgEdHint();
|
|
|
|
|
|
|
|
DlgEdHintKind GetKind() const { return eHintKind; }
|
|
|
|
DlgEdObj* GetObject() const { return pDlgEdObj; }
|
|
|
|
};
|
2001-02-26 09:52:34 +00:00
|
|
|
|
2002-04-24 13:52:16 +00:00
|
|
|
|
2001-02-26 09:52:34 +00:00
|
|
|
//============================================================================
|
2001-03-23 15:13:46 +00:00
|
|
|
// DlgEditor
|
2001-02-26 09:52:34 +00:00
|
|
|
//============================================================================
|
|
|
|
|
2003-03-26 11:51:00 +00:00
|
|
|
enum DlgEdMode { DLGED_INSERT, DLGED_SELECT, DLGED_TEST, DLGED_READONLY };
|
|
|
|
|
2001-03-23 15:13:46 +00:00
|
|
|
class ScrollBar;
|
2003-03-26 11:51:00 +00:00
|
|
|
class DlgEdModel;
|
|
|
|
class DlgEdPage;
|
|
|
|
class DlgEdView;
|
2001-03-23 15:13:46 +00:00
|
|
|
class DlgEdForm;
|
|
|
|
class DlgEdFactory;
|
|
|
|
class DlgEdFunc;
|
2001-02-26 09:52:34 +00:00
|
|
|
class Printer;
|
2003-03-26 11:51:00 +00:00
|
|
|
class KeyEvent;
|
|
|
|
class MouseEvent;
|
|
|
|
class Timer;
|
|
|
|
class Window;
|
2001-02-26 09:52:34 +00:00
|
|
|
|
2003-03-26 11:51:00 +00:00
|
|
|
class DlgEditor: public SfxBroadcaster
|
2001-02-26 09:52:34 +00:00
|
|
|
{
|
2001-03-23 15:13:46 +00:00
|
|
|
private:
|
2001-02-26 09:52:34 +00:00
|
|
|
DECL_LINK( PaintTimeout, Timer * );
|
2003-05-22 07:44:31 +00:00
|
|
|
DECL_LINK( MarkTimeout, Timer * );
|
2001-03-23 15:13:46 +00:00
|
|
|
|
2009-05-25 09:48:15 +00:00
|
|
|
void Print( Printer* pPrinter, const String& rTitle );
|
2009-05-19 11:32:44 +00:00
|
|
|
|
2001-02-26 09:52:34 +00:00
|
|
|
protected:
|
|
|
|
ScrollBar* pHScroll;
|
|
|
|
ScrollBar* pVScroll;
|
2003-03-26 11:51:00 +00:00
|
|
|
DlgEdModel* pDlgEdModel;
|
|
|
|
DlgEdPage* pDlgEdPage;
|
|
|
|
DlgEdView* pDlgEdView;
|
2001-02-26 09:52:34 +00:00
|
|
|
DlgEdForm* pDlgEdForm;
|
2001-04-10 14:18:14 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > m_xUnoControlDialogModel;
|
2006-11-14 14:29:26 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > m_xControlContainer;
|
2001-04-10 14:18:14 +00:00
|
|
|
::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > m_ClipboardDataFlavors;
|
2007-01-29 15:52:46 +00:00
|
|
|
::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > m_ClipboardDataFlavorsResource;
|
2001-09-25 10:06:10 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > m_xSupplier;
|
2001-03-23 15:13:46 +00:00
|
|
|
DlgEdFactory* pObjFac;
|
2001-02-26 09:52:34 +00:00
|
|
|
Window* pWindow;
|
|
|
|
DlgEdFunc* pFunc;
|
2001-08-17 12:57:40 +00:00
|
|
|
DlgEdMode eMode;
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_uInt16 eActObj;
|
|
|
|
sal_Bool bFirstDraw;
|
2001-02-26 09:52:34 +00:00
|
|
|
Size aGridSize;
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_Bool bGridVisible;
|
|
|
|
sal_Bool bGridSnap;
|
|
|
|
sal_Bool bCreateOK;
|
2001-02-26 09:52:34 +00:00
|
|
|
Timer aPaintTimer;
|
|
|
|
Rectangle aPaintRect;
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_Bool bDialogModelChanged;
|
2003-05-22 07:44:31 +00:00
|
|
|
Timer aMarkTimer;
|
2007-08-28 08:51:31 +00:00
|
|
|
long mnPaintGuard;
|
2010-10-06 10:16:13 +01:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xDocument;
|
2001-02-26 09:52:34 +00:00
|
|
|
|
2010-10-06 10:16:13 +01:00
|
|
|
DlgEditor(); // not implemented
|
2001-02-26 09:52:34 +00:00
|
|
|
public:
|
2010-10-06 10:16:13 +01:00
|
|
|
DlgEditor( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel );
|
2001-03-23 15:13:46 +00:00
|
|
|
~DlgEditor();
|
2001-02-26 09:52:34 +00:00
|
|
|
|
|
|
|
void SetWindow( Window* pWindow );
|
|
|
|
Window* GetWindow() const { return pWindow; }
|
|
|
|
|
2006-11-14 14:29:26 +00:00
|
|
|
/** returns the control container associated with our window
|
|
|
|
@see GetWindow
|
|
|
|
@see SetWindow
|
|
|
|
*/
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >
|
|
|
|
GetWindowControlContainer();
|
|
|
|
|
2001-02-26 09:52:34 +00:00
|
|
|
void SetDlgEdForm( DlgEdForm* pForm ) { pDlgEdForm = pForm; }
|
|
|
|
DlgEdForm* GetDlgEdForm() const { return pDlgEdForm; }
|
|
|
|
|
|
|
|
void SetScrollBars( ScrollBar* pHScroll, ScrollBar* pVScroll );
|
2004-12-10 16:02:40 +00:00
|
|
|
void InitScrollBars();
|
2001-02-26 09:52:34 +00:00
|
|
|
ScrollBar* GetHScroll() const { return pHScroll; }
|
|
|
|
ScrollBar* GetVScroll() const { return pVScroll; }
|
|
|
|
void DoScroll( ScrollBar* pActScroll );
|
2002-04-24 13:52:16 +00:00
|
|
|
void UpdateScrollBars();
|
2001-02-26 09:52:34 +00:00
|
|
|
|
2001-03-03 13:36:55 +00:00
|
|
|
void SetDialog( ::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::container::XNameContainer > xUnoControlDialogModel );
|
2007-06-20 09:39:53 +00:00
|
|
|
void ResetDialog( void );
|
2001-03-03 13:36:55 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > GetDialog() const
|
|
|
|
{return m_xUnoControlDialogModel;}
|
2001-02-26 09:52:34 +00:00
|
|
|
|
2001-09-25 10:06:10 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > const & GetNumberFormatsSupplier();
|
|
|
|
|
2003-03-26 11:51:00 +00:00
|
|
|
DlgEdModel* GetModel() const { return pDlgEdModel; }
|
|
|
|
DlgEdView* GetView() const { return pDlgEdView; }
|
|
|
|
DlgEdPage* GetPage() const { return pDlgEdPage; }
|
2001-02-26 09:52:34 +00:00
|
|
|
|
|
|
|
void ShowDialog();
|
|
|
|
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_Bool UnmarkDialog();
|
|
|
|
sal_Bool RemarkDialog();
|
2001-02-26 09:52:34 +00:00
|
|
|
|
2011-01-14 11:16:25 +01:00
|
|
|
void SetDialogModelChanged( sal_Bool bChanged = sal_True ) { bDialogModelChanged = bChanged; }
|
|
|
|
sal_Bool IsDialogModelChanged() const { return bDialogModelChanged; }
|
2001-03-06 13:50:13 +00:00
|
|
|
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_Bool IsModified() const;
|
2001-02-26 09:52:34 +00:00
|
|
|
void ClearModifyFlag();
|
|
|
|
|
|
|
|
void MouseButtonDown( const MouseEvent& rMEvt );
|
|
|
|
void MouseButtonUp( const MouseEvent& rMEvt );
|
|
|
|
void MouseMove( const MouseEvent& rMEvt );
|
|
|
|
void Paint( const Rectangle& rRect );
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_Bool KeyInput( const KeyEvent& rKEvt );
|
2001-02-26 09:52:34 +00:00
|
|
|
|
2001-08-17 12:57:40 +00:00
|
|
|
void SetMode( DlgEdMode eMode );
|
2011-01-14 11:16:25 +01:00
|
|
|
void SetInsertObj( sal_uInt16 eObj );
|
|
|
|
sal_uInt16 GetInsertObj() const;
|
2002-04-24 13:52:16 +00:00
|
|
|
void CreateDefaultObject();
|
2001-08-17 12:57:40 +00:00
|
|
|
DlgEdMode GetMode() const { return eMode; }
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_Bool IsCreateOK() const { return bCreateOK; }
|
2001-02-26 09:52:34 +00:00
|
|
|
|
2001-04-10 14:18:14 +00:00
|
|
|
void Cut();
|
|
|
|
void Copy();
|
|
|
|
void Paste();
|
2001-02-26 09:52:34 +00:00
|
|
|
void Delete();
|
2011-01-14 11:16:25 +01:00
|
|
|
sal_Bool IsPasteAllowed();
|
2001-10-17 09:17:18 +00:00
|
|
|
|
|
|
|
void ShowProperties();
|
2003-05-22 07:44:31 +00:00
|
|
|
void UpdatePropertyBrowserDelayed();
|
2001-02-26 09:52:34 +00:00
|
|
|
|
2009-05-19 11:32:44 +00:00
|
|
|
sal_Int32 countPages( Printer* pPrinter );
|
|
|
|
void printPage( sal_Int32 nPage, Printer* pPrinter, const String& );
|
2004-12-10 16:02:40 +00:00
|
|
|
|
|
|
|
bool AdjustPageSize();
|
2007-08-28 08:51:31 +00:00
|
|
|
|
|
|
|
bool isInPaint() const { return mnPaintGuard > 0; }
|
2001-02-26 09:52:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif //_BASCTL_DLGED_HXX
|
2010-10-27 12:45:03 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|