Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef _SD_TABLEDESIGNPANE_HXX
21 : #define _SD_TABLEDESIGNPANE_HXX
22 :
23 : #include <com/sun/star/beans/XPropertySet.hpp>
24 : #include <com/sun/star/ui/XUIElement.hpp>
25 : #include <com/sun/star/drawing/XDrawView.hpp>
26 : #include <com/sun/star/container/XIndexAccess.hpp>
27 :
28 : #include <vcl/dialog.hxx>
29 : #include <vcl/fixed.hxx>
30 : #include <vcl/button.hxx>
31 :
32 : #include <boost/scoped_ptr.hpp>
33 :
34 : #include "TableDesignPane.hrc"
35 :
36 : namespace sd
37 : {
38 :
39 : namespace tools {
40 : class EventMultiplexerEvent;
41 : }
42 :
43 : class ViewShellBase;
44 :
45 : // --------------------------------------------------------------------
46 :
47 : class TableDesignPane : public Control
48 : {
49 : public:
50 : TableDesignPane( ::Window* pParent, ViewShellBase& rBase, bool bModal );
51 : virtual ~TableDesignPane();
52 :
53 : // callbacks
54 : void onSelectionChanged();
55 :
56 : // Control
57 : virtual void Resize();
58 :
59 : virtual void DataChanged( const DataChangedEvent& rDCEvt );
60 :
61 : void ApplyOptions();
62 : void ApplyStyle();
63 :
64 0 : bool isStyleChanged() const { return mbStyleSelected; }
65 0 : bool isOptionsChanged() const { return mbOptionsChanged; }
66 :
67 : private:
68 : void addListener();
69 : void removeListener();
70 : void updateLayout();
71 : void updateControls();
72 :
73 : void FillDesignPreviewControl();
74 :
75 : DECL_LINK(EventMultiplexerListener, tools::EventMultiplexerEvent*);
76 : DECL_LINK(implValueSetHdl, void *);
77 : DECL_LINK(implCheckBoxHdl, void *);
78 :
79 : private:
80 : ViewShellBase& mrBase;
81 : const rtl::OUString msTableTemplate;
82 :
83 : boost::scoped_ptr< Control > mxControls[DESIGNPANE_CONTROL_COUNT];
84 : int mnOrgOffsetY[DESIGNPANE_CONTROL_COUNT];
85 :
86 : ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxSelectedTable;
87 : ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawView > mxView;
88 : ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > mxTableFamily;
89 : ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement > mxToolbar;
90 :
91 : bool mbModal;
92 : bool mbStyleSelected;
93 : bool mbOptionsChanged;
94 : };
95 :
96 : // --------------------------------------------------------------------
97 :
98 0 : class TableDesignDialog : public ModalDialog
99 : {
100 : public:
101 : TableDesignDialog( ::Window* pParent, ViewShellBase& rBase );
102 :
103 : virtual short Execute();
104 : private:
105 : boost::scoped_ptr< TableDesignPane > mpDesignPane;
106 :
107 : boost::scoped_ptr< FixedLine > mxFlSep1;
108 : boost::scoped_ptr< FixedLine > mxFlSep2;
109 : boost::scoped_ptr< HelpButton > mxHelpButton;
110 : boost::scoped_ptr< OKButton > mxOkButton;
111 : boost::scoped_ptr< CancelButton > mxCancelButton;
112 : };
113 :
114 : }
115 :
116 : #endif // _SD_TABLEFORMATPANE_HXX
117 :
118 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|