2010-10-27 12:53:26 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-11-27 16:10:40 +00: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 .
|
|
|
|
*/
|
2008-03-12 10:46:59 +00:00
|
|
|
|
2013-10-23 22:38:46 +02:00
|
|
|
#ifndef INCLUDED_SD_SOURCE_UI_TABLE_TABLEDESIGNPANE_HXX
|
|
|
|
#define INCLUDED_SD_SOURCE_UI_TABLE_TABLEDESIGNPANE_HXX
|
2008-03-12 10:46:59 +00:00
|
|
|
|
|
|
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
|
|
|
#include <com/sun/star/ui/XUIElement.hpp>
|
2013-04-10 08:20:16 +00:00
|
|
|
#include <com/sun/star/ui/LayoutSize.hpp>
|
2008-03-12 10:46:59 +00:00
|
|
|
#include <com/sun/star/drawing/XDrawView.hpp>
|
|
|
|
#include <com/sun/star/container/XIndexAccess.hpp>
|
|
|
|
|
2013-11-14 12:45:25 +00:00
|
|
|
#include <svtools/valueset.hxx>
|
2008-03-12 10:46:59 +00:00
|
|
|
#include <vcl/dialog.hxx>
|
|
|
|
#include <vcl/fixed.hxx>
|
|
|
|
#include <vcl/button.hxx>
|
2013-11-14 12:45:25 +00:00
|
|
|
#include <svx/sidebar/PanelLayout.hxx>
|
2008-03-12 10:46:59 +00:00
|
|
|
|
2015-09-18 09:09:12 +01:00
|
|
|
#include <memory>
|
2008-03-12 10:46:59 +00:00
|
|
|
|
|
|
|
namespace sd
|
|
|
|
{
|
|
|
|
|
|
|
|
namespace tools {
|
|
|
|
class EventMultiplexerEvent;
|
|
|
|
}
|
|
|
|
|
|
|
|
class ViewShellBase;
|
|
|
|
|
2013-11-14 12:45:25 +00:00
|
|
|
#define CB_HEADER_ROW 0
|
|
|
|
#define CB_TOTAL_ROW 1
|
|
|
|
#define CB_BANDED_ROWS 2
|
|
|
|
#define CB_FIRST_COLUMN 3
|
|
|
|
#define CB_LAST_COLUMN 4
|
|
|
|
#define CB_BANDED_COLUMNS 5
|
|
|
|
#define CB_COUNT CB_BANDED_COLUMNS-CB_HEADER_ROW+1
|
|
|
|
|
|
|
|
class TableValueSet : public ValueSet
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
bool m_bModal;
|
|
|
|
public:
|
2014-09-23 11:20:40 +02:00
|
|
|
TableValueSet(vcl::Window *pParent, WinBits nStyle);
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void Resize() override;
|
|
|
|
virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
|
2013-11-14 12:45:25 +00:00
|
|
|
void updateSettings();
|
|
|
|
void setModal(bool bModal) { m_bModal = bModal; }
|
|
|
|
};
|
|
|
|
|
2016-11-07 13:33:38 +02:00
|
|
|
class TableDesignWidget final
|
2008-03-12 10:46:59 +00:00
|
|
|
{
|
|
|
|
public:
|
2013-11-15 09:40:22 +00:00
|
|
|
TableDesignWidget( VclBuilderContainer* pParent, ViewShellBase& rBase, bool bModal );
|
2016-11-07 13:33:38 +02:00
|
|
|
~TableDesignWidget();
|
2008-03-12 10:46:59 +00:00
|
|
|
|
|
|
|
// callbacks
|
|
|
|
void onSelectionChanged();
|
|
|
|
|
|
|
|
void ApplyOptions();
|
|
|
|
void ApplyStyle();
|
|
|
|
|
|
|
|
bool isStyleChanged() const { return mbStyleSelected; }
|
|
|
|
bool isOptionsChanged() const { return mbOptionsChanged; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
void addListener();
|
|
|
|
void removeListener();
|
|
|
|
void updateControls();
|
|
|
|
|
|
|
|
void FillDesignPreviewControl();
|
|
|
|
|
2016-10-05 07:56:12 +02:00
|
|
|
DECL_LINK(EventMultiplexerListener, tools::EventMultiplexerEvent&, void);
|
|
|
|
DECL_LINK(implValueSetHdl, ValueSet*, void);
|
|
|
|
DECL_LINK(implCheckBoxHdl, Button*, void);
|
2008-03-12 10:46:59 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
ViewShellBase& mrBase;
|
|
|
|
|
2015-03-09 14:29:30 +02:00
|
|
|
VclPtr<TableValueSet> m_pValueSet;
|
|
|
|
VclPtr<CheckBox> m_aCheckBoxes[CB_COUNT];
|
2008-03-12 10:46:59 +00:00
|
|
|
|
2015-10-28 12:01:32 +02:00
|
|
|
css::uno::Reference< css::beans::XPropertySet > mxSelectedTable;
|
|
|
|
css::uno::Reference< css::drawing::XDrawView > mxView;
|
|
|
|
css::uno::Reference< css::container::XIndexAccess > mxTableFamily;
|
2008-03-12 10:46:59 +00:00
|
|
|
|
|
|
|
bool mbModal;
|
|
|
|
bool mbStyleSelected;
|
|
|
|
bool mbOptionsChanged;
|
|
|
|
};
|
|
|
|
|
2013-11-15 09:40:22 +00:00
|
|
|
class TableDesignPane : public PanelLayout
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
TableDesignWidget aImpl;
|
|
|
|
public:
|
2014-09-23 11:20:40 +02:00
|
|
|
TableDesignPane( vcl::Window* pParent, ViewShellBase& rBase )
|
2013-11-15 09:40:22 +00:00
|
|
|
: PanelLayout(pParent, "TableDesignPanel",
|
2015-10-28 12:01:32 +02:00
|
|
|
"modules/simpress/ui/tabledesignpanel.ui", css::uno::Reference<css::frame::XFrame>())
|
2013-11-15 09:40:22 +00:00
|
|
|
, aImpl(this, rBase, false)
|
|
|
|
{
|
|
|
|
}
|
2016-07-08 00:03:43 +02:00
|
|
|
TableDesignPane( vcl::Window* pParent, ViewShellBase& rBase, bool )
|
|
|
|
: PanelLayout(pParent, "TableDesignPanel",
|
|
|
|
"modules/simpress/ui/tabledesignpanelhorizontal.ui", css::uno::Reference<css::frame::XFrame>())
|
|
|
|
, aImpl(this, rBase, false)
|
|
|
|
{
|
|
|
|
}
|
2013-11-15 09:40:22 +00:00
|
|
|
};
|
|
|
|
|
2008-03-12 10:46:59 +00:00
|
|
|
class TableDesignDialog : public ModalDialog
|
|
|
|
{
|
2013-11-15 09:40:22 +00:00
|
|
|
private:
|
|
|
|
TableDesignWidget aImpl;
|
2008-03-12 10:46:59 +00:00
|
|
|
public:
|
2014-09-23 11:20:40 +02:00
|
|
|
TableDesignDialog( vcl::Window* pParent, ViewShellBase& rBase )
|
2013-11-15 09:40:22 +00:00
|
|
|
: ModalDialog(pParent, "TableDesignDialog",
|
|
|
|
"modules/sdraw/ui/tabledesigndialog.ui")
|
|
|
|
, aImpl(this, rBase, true)
|
|
|
|
{
|
|
|
|
}
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual short Execute() override;
|
2008-03-12 10:46:59 +00:00
|
|
|
};
|
|
|
|
|
2014-09-23 11:20:40 +02:00
|
|
|
void showTableDesignDialog( vcl::Window*, ViewShellBase& );
|
2014-04-14 17:55:19 +02:00
|
|
|
|
2008-03-12 10:46:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif // _SD_TABLEFORMATPANE_HXX
|
2010-10-27 12:53:26 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|