217 lines
7.0 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
2014-04-18 18:32:22 +02:00
#ifndef INCLUDED_BASCTL_SOURCE_INC_DLGED_HXX
#define INCLUDED_BASCTL_SOURCE_INC_DLGED_HXX
2001-02-26 09:52:34 +00:00
#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/SfxBroadcaster.hxx>
#include <svl/hint.hxx>
#include <tools/gen.hxx>
#include <vcl/timer.hxx>
#include <boost/scoped_ptr.hpp>
class ScrollBar;
class Printer;
class KeyEvent;
class MouseEvent;
class Timer;
namespace vcl { class Window; }
namespace basctl
{
class DialogWindowLayout;
#define DLGED_PAGE_WIDTH_MIN 1280
#define DLGED_PAGE_HEIGHT_MIN 1024
// DlgEdHint
class DlgEdObj;
class DlgEdHint: public SfxHint
{
public:
enum Kind {
UNKNOWN,
WINDOWSCROLLED,
LAYERCHANGED,
OBJORDERCHANGED,
SELECTIONCHANGED,
};
private:
Kind eKind;
DlgEdObj* pDlgEdObj;
public:
DlgEdHint (Kind);
DlgEdHint (Kind, DlgEdObj* pObj);
virtual ~DlgEdHint();
Kind GetKind() const { return eKind; }
DlgEdObj* GetObject() const { return pDlgEdObj; }
};
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
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 DlgEditor: public SfxBroadcaster
2001-02-26 09:52:34 +00:00
{
public:
enum Mode {
INSERT,
SELECT,
TEST,
READONLY,
};
2001-03-23 15:13:46 +00:00
private:
DECL_LINK(MarkTimeout, void *);
2001-03-23 15:13:46 +00:00
void Print( Printer* pPrinter, const OUString& rTitle );
2009-05-19 11:32:44 +00:00
private:
2001-02-26 09:52:34 +00:00
ScrollBar* pHScroll;
ScrollBar* pVScroll;
boost::scoped_ptr<DlgEdModel> pDlgEdModel; // never nullptr
DlgEdPage* pDlgEdPage; // never nullptr
boost::scoped_ptr<DlgEdView> pDlgEdView; // never nullptr
DlgEdForm* pDlgEdForm; // never nullptr
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;
boost::scoped_ptr<DlgEdFactory> pObjFac; // never nullptr
vcl::Window& rWindow; // DialogWindow
boost::scoped_ptr<DlgEdFunc> pFunc;
DialogWindowLayout& rLayout;
Mode eMode;
sal_uInt16 eActObj;
bool bFirstDraw;
2001-02-26 09:52:34 +00:00
Size aGridSize;
bool bGridVisible;
bool bGridSnap;
bool bCreateOK;
2001-02-26 09:52:34 +00:00
Rectangle aPaintRect;
bool bDialogModelChanged;
Idle aMarkIdle;
long mnPaintGuard;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xDocument;
2001-02-26 09:52:34 +00:00
public:
DlgEditor (
vcl::Window&, DialogWindowLayout&,
com::sun::star::uno::Reference<com::sun::star::frame::XModel> const& xModel,
com::sun::star::uno::Reference<com::sun::star::container::XNameContainer> xDialogModel
);
virtual ~DlgEditor();
2001-02-26 09:52:34 +00:00
vcl::Window& GetWindow() const { return rWindow; }
2001-02-26 09:52:34 +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 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 ();
::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();
bool UnmarkDialog();
bool RemarkDialog();
2001-02-26 09:52:34 +00:00
void SetDialogModelChanged (bool bChanged = true) { bDialogModelChanged = bChanged; }
bool IsDialogModelChanged () const { return bDialogModelChanged; }
2001-03-06 13:50:13 +00:00
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 );
bool KeyInput( const KeyEvent& rKEvt );
2001-02-26 09:52:34 +00:00
void SetMode (Mode eMode);
void SetInsertObj( sal_uInt16 eObj );
sal_uInt16 GetInsertObj() const { return eActObj;}
void CreateDefaultObject();
Mode GetMode() const { return eMode; }
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();
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 );
void printPage( sal_Int32 nPage, Printer* pPrinter, const OUString& );
bool AdjustPageSize();
bool isInPaint() const { return mnPaintGuard > 0; }
2001-02-26 09:52:34 +00:00
};
} // namespace basctl
2014-04-18 18:32:22 +02:00
#endif // INCLUDED_BASCTL_SOURCE_INC_DLGED_HXX
2010-10-27 12:45:03 +01:00
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */