205 lines
7.3 KiB
C++
Raw Normal View History

2010-10-27 12:45:03 +01:00
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2012-06-12 17:02:47 +01:00
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
2001-02-26 09:52:34 +00:00
#ifndef _BASCTL_DLGED_HXX
#define _BASCTL_DLGED_HXX
#include <com/sun/star/awt/XControlContainer.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
2001-04-10 14:18:14 +00:00
#include <com/sun/star/datatransfer/DataFlavor.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <svl/brdcst.hxx>
#include <svl/hint.hxx>
#include <tools/gen.hxx>
#include <vcl/timer.hxx>
#define DLGED_PAGE_WIDTH_MIN 1280
#define DLGED_PAGE_HEIGHT_MIN 1024
//============================================================================
// 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
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
//============================================================================
enum DlgEdMode { DLGED_INSERT, DLGED_SELECT, DLGED_TEST, DLGED_READONLY };
2001-03-23 15:13:46 +00:00
class ScrollBar;
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;
class KeyEvent;
class MouseEvent;
class Timer;
class Window;
2001-02-26 09:52:34 +00:00
class DlgEditor: public SfxBroadcaster
2001-02-26 09:52:34 +00:00
{
2001-03-23 15:13:46 +00:00
private:
DECL_LINK(PaintTimeout, void *);
DECL_LINK(MarkTimeout, void *);
2001-03-23 15:13:46 +00:00
2011-11-22 00:00:33 -05:00
void Print( Printer* pPrinter, const ::rtl::OUString& rTitle );
2009-05-19 11:32:44 +00:00
2001-02-26 09:52:34 +00:00
protected:
ScrollBar* pHScroll;
ScrollBar* pVScroll;
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;
::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;
::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > m_ClipboardDataFlavorsResource;
::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;
DlgEdMode eMode;
sal_uInt16 eActObj;
sal_Bool bFirstDraw;
2001-02-26 09:52:34 +00:00
Size aGridSize;
sal_Bool bGridVisible;
sal_Bool bGridSnap;
sal_Bool bCreateOK;
2001-02-26 09:52:34 +00:00
Timer aPaintTimer;
Rectangle aPaintRect;
sal_Bool bDialogModelChanged;
Timer aMarkTimer;
long mnPaintGuard;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xDocument;
2001-02-26 09:52:34 +00:00
DlgEditor(); // not implemented
2001-02-26 09:52:34 +00:00
public:
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; }
/** 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 );
void InitScrollBars();
2001-02-26 09:52:34 +00:00
ScrollBar* GetHScroll() const { return pHScroll; }
ScrollBar* GetVScroll() const { return pVScroll; }
void DoScroll( ScrollBar* pActScroll );
void UpdateScrollBars();
2001-02-26 09:52:34 +00:00
void SetDialog( ::com::sun::star::uno::Reference<
::com::sun::star::container::XNameContainer > xUnoControlDialogModel );
void ResetDialog( void );
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > GetDialog() const
{return m_xUnoControlDialogModel;}
2001-02-26 09:52:34 +00:00
::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > const & GetNumberFormatsSupplier();
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();
sal_Bool UnmarkDialog();
sal_Bool RemarkDialog();
2001-02-26 09:52:34 +00:00
void SetDialogModelChanged( sal_Bool bChanged = sal_True ) { bDialogModelChanged = bChanged; }
sal_Bool IsDialogModelChanged() const { return bDialogModelChanged; }
2001-03-06 13:50:13 +00: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 );
sal_Bool KeyInput( const KeyEvent& rKEvt );
2001-02-26 09:52:34 +00:00
void SetMode( DlgEdMode eMode );
void SetInsertObj( sal_uInt16 eObj );
sal_uInt16 GetInsertObj() const;
void CreateDefaultObject();
DlgEdMode GetMode() const { return eMode; }
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();
sal_Bool IsPasteAllowed();
void ShowProperties();
void UpdatePropertyBrowserDelayed();
2001-02-26 09:52:34 +00:00
2009-05-19 11:32:44 +00:00
sal_Int32 countPages( Printer* pPrinter );
2011-11-22 00:00:33 -05:00
void printPage( sal_Int32 nPage, Printer* pPrinter, const ::rtl::OUString& );
bool AdjustPageSize();
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: */