LibreOffice Module dbaccess (master) 1
AppView.hxx
Go to the documentation of this file.
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#pragma once
20
21#include <dbaccess/dataview.hxx>
22#include <com/sun/star/ucb/XContent.hpp>
23#include <com/sun/star/sdb/application/NamedDatabaseObject.hpp>
24#include <com/sun/star/sdbc/XConnection.hpp>
27#include <vcl/weld.hxx>
28#include <IClipBoardTest.hxx>
29#include <AppElementType.hxx>
30
31namespace com::sun::star::beans { class XPropertySet; }
32
34
35namespace dbaui
36{
37 class OApplicationView;
38 class OApplicationDetailView;
39 class OApplicationSwapWindow;
40 class OTitleWindow;
41 class OApplicationController;
42
44 {
45 std::unique_ptr<weld::Container> m_xPanelParent;
46 std::unique_ptr<weld::Container> m_xDetailViewParent;
47 std::unique_ptr<OTitleWindow> m_xPanel;
48 std::unique_ptr<OApplicationDetailView> m_xDetailView;
50
51 public:
52 OAppBorderWindow(OApplicationView* pParent, PreviewMode ePreviewMode);
53 virtual ~OAppBorderWindow() override;
54 virtual void dispose() override;
55
56 // Window overrides
57 virtual void GetFocus() override;
58
59 OApplicationView* getView() const { return m_xView.get(); }
63 };
64
66 ,public IClipboardTest
68 {
70 {
73 NONE
74 };
75 private:
76 css::uno::Reference< css::lang::XComponent >
80
83
84 void ImplInitSettings();
85 protected:
86
87 // return the Rectangle where I can paint myself
88 virtual void resizeDocumentView(tools::Rectangle& rRect) override;
89
90 // OEventListenerAdapter
91 virtual void _disposing( const css::lang::EventObject& _rSource ) override;
92
93 // Window
94 virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
95 public:
97 ,const css::uno::Reference< css::uno::XComponentContext >&
98 ,OApplicationController& _rAppController
99 ,PreviewMode _ePreviewMode
100 );
101 virtual ~OApplicationView() override;
102 virtual void dispose() override;
103
105 void createIconAutoMnemonics( MnemonicGenerator& _rMnemonics );
106
108 void setTaskExternalMnemonics( MnemonicGenerator const & _rMnemonics );
109
110 // Window overrides
111 virtual bool PreNotify( NotifyEvent& rNEvt ) override;
112 virtual void GetFocus() override;
113
115
116 // IClipboardTest
117 virtual bool isCutAllowed() override;
118 virtual bool isCopyAllowed() override;
119 virtual bool isPasteAllowed() override;
120 virtual void copy() override;
121 virtual void cut() override;
122 virtual void paste() override;
123
125 OApplicationSwapWindow* getPanel() const { return m_pWin->getPanel(); }
127 OApplicationDetailView* getDetailView() const { return m_pWin->getDetailView(); }
128
136 OUString getQualifiedName(const weld::TreeIter* _pEntry) const;
137
146 bool isLeaf(const weld::TreeView& rTreeView, const weld::TreeIter& rEntry) const;
147
152 bool isALeafSelected() const;
153
156 void selectAll();
157
159 bool isSortUp() const;
160
162 void sortDown();
163
165 void sortUp();
166
168 bool isFilled() const;
169
172
174 sal_Int32 getElementCount() const;
175
177 sal_Int32 getSelectionCount() const;
178
182 void clearPages();
183
188 void getSelectionElementNames( std::vector< OUString>& _rNames ) const;
189
193 const weld::TreeView& rControl,
194 css::uno::Sequence< css::sdb::application::NamedDatabaseObject >& _out_rSelectedObjects
195 );
196
200 const ElementType _eType,
201 css::uno::Sequence< css::sdb::application::NamedDatabaseObject >& _out_rSelectedObjects
202 );
203
206 vcl::Window* getMenuParent() const;
207
209 void adjustMenuPosition(const weld::TreeView& rControl, ::Point& rPos) const;
210
215 void selectElements(const css::uno::Sequence< OUString>& _aNames);
216
227 std::unique_ptr<weld::TreeIter> elementAdded(ElementType eType,
228 const OUString& rName,
229 const css::uno::Any& rObject);
230
244 ,const OUString& _rOldName
245 ,const OUString& _rNewName );
246
255 void elementRemoved(ElementType _eType
256 ,const OUString& _rName );
257
262 void selectContainer(ElementType _eType);
263
266
268 bool isPreviewEnabled() const;
269
274 void switchPreview(PreviewMode _eMode);
275
280 void showPreview(const css::uno::Reference< css::ucb::XContent >& _xContent);
281
293 void showPreview( const OUString& _sDataSourceName,
294 const css::uno::Reference< css::sdbc::XConnection>& _xConnection,
295 const OUString& _sName,
296 bool _bTable);
297
298 std::unique_ptr<weld::TreeIter> getEntry(const Point& rPosPixel) const;
299 };
300}
301
302/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Container > m_xContainer
std::unique_ptr< weld::Container > m_xPanelParent
Definition: AppView.hxx:45
std::unique_ptr< weld::Container > m_xDetailViewParent
Definition: AppView.hxx:46
virtual void GetFocus() override
Definition: AppView.cxx:79
OApplicationSwapWindow * getPanel() const
Definition: AppView.cxx:85
std::unique_ptr< OTitleWindow > m_xPanel
Definition: AppView.hxx:47
weld::Container & getTopLevel()
Definition: AppView.hxx:62
OAppBorderWindow(OApplicationView *pParent, PreviewMode ePreviewMode)
Definition: AppView.cxx:45
OApplicationDetailView * getDetailView() const
Definition: AppView.hxx:61
virtual ~OAppBorderWindow() override
Definition: AppView.cxx:63
VclPtr< OApplicationView > m_xView
Definition: AppView.hxx:49
OApplicationView * getView() const
Definition: AppView.hxx:59
std::unique_ptr< OApplicationDetailView > m_xDetailView
Definition: AppView.hxx:48
virtual void dispose() override
Definition: AppView.cxx:68
sal_Int32 getSelectionCount() const
returns the count of selected entries
Definition: AppView.cxx:294
OApplicationDetailView * getDetailView() const
get the detail page
Definition: AppView.hxx:127
OApplicationController & getAppController() const
Definition: AppView.hxx:114
bool isALeafSelected() const
returns if one of the selected entries is a leaf
Definition: AppView.cxx:252
bool isFilled() const
returns <TRUE> when a detail page was filled
Definition: AppView.cxx:282
virtual bool isPasteAllowed() override
Definition: AppView.cxx:213
std::unique_ptr< weld::TreeIter > elementAdded(ElementType eType, const OUString &rName, const css::uno::Any &rObject)
adds a new object to the detail page.
Definition: AppView.cxx:342
OApplicationView(vcl::Window *pParent, const css::uno::Reference< css::uno::XComponentContext > &, OApplicationController &_rAppController, PreviewMode _ePreviewMode)
Definition: AppView.cxx:90
PreviewMode getPreviewMode() const
returns the preview mode
Definition: AppView.cxx:382
OUString getQualifiedName(const weld::TreeIter *_pEntry) const
return the qualified name.
Definition: AppView.cxx:240
void showPreview(const css::uno::Reference< css::ucb::XContent > &_xContent)
shows the Preview of the content when it is enabled.
void elementReplaced(ElementType eType, const OUString &_rOldName, const OUString &_rNewName)
replaces an objects name with a new one
Definition: AppView.cxx:354
bool isPreviewEnabled() const
<TRUE> if the preview is enabled
Definition: AppView.cxx:388
void selectElements(const css::uno::Sequence< OUString > &_aNames)
select all names on the currently selected container.
Definition: AppView.cxx:336
virtual void GetFocus() override
Definition: AppView.cxx:446
virtual void dispose() override
Definition: AppView.cxx:109
void clearPages()
clears the detail page and the selection on the left side.
Definition: AppView.cxx:362
void getSelectionElementNames(std::vector< OUString > &_rNames) const
returns the element names which are selected
Definition: AppView.cxx:306
virtual bool isCopyAllowed() override
Definition: AppView.cxx:201
void selectAll()
select all entries in the detail page
Definition: AppView.cxx:258
css::uno::Reference< css::lang::XComponent > m_xObject
Definition: AppView.hxx:77
void switchPreview(PreviewMode _eMode)
switches to the given preview mode
Definition: AppView.cxx:394
bool isSortUp() const
returns <TRUE> if it sorts ascending
Definition: AppView.cxx:264
void elementRemoved(ElementType _eType, const OUString &_rName)
removes an element from the detail page.
Definition: AppView.cxx:348
virtual bool PreNotify(NotifyEvent &rNEvt) override
Definition: AppView.cxx:173
ElementType getElementType() const
return the element of currently select entry
Definition: AppView.cxx:288
void sortDown()
sort the entries in the detail page down
Definition: AppView.cxx:270
virtual void resizeDocumentView(tools::Rectangle &rRect) override
Definition: AppView.cxx:145
sal_Int32 getElementCount() const
returns the count of entries
Definition: AppView.cxx:300
void selectContainer(ElementType _eType)
changes the container which should be displayed.
Definition: AppView.cxx:369
void createIconAutoMnemonics(MnemonicGenerator &_rMnemonics)
automatically creates mnemonics for the icon/texts in our left hand side panel
Definition: AppView.cxx:118
vcl::Window * getMenuParent() const
get the menu parent window for the given control
Definition: AppView.cxx:318
OApplicationController & m_rAppController
Definition: AppView.hxx:79
void describeCurrentSelectionForType(const ElementType _eType, css::uno::Sequence< css::sdb::application::NamedDatabaseObject > &_out_rSelectedObjects)
describes the current selection for the given ElementType
Definition: AppView.cxx:330
virtual void paste() override
Definition: AppView.cxx:233
void sortUp()
sort the entries in the detail page up
Definition: AppView.cxx:276
IClipboardTest * getActiveChild() const
Definition: AppView.cxx:193
virtual void cut() override
Definition: AppView.cxx:226
virtual void _disposing(const css::lang::EventObject &_rSource) override
Definition: AppView.cxx:452
void adjustMenuPosition(const weld::TreeView &rControl, ::Point &rPos) const
adjust rPos relative to rControl to instead relative to getMenuParent
Definition: AppView.cxx:324
void describeCurrentSelectionForControl(const weld::TreeView &rControl, css::uno::Sequence< css::sdb::application::NamedDatabaseObject > &_out_rSelectedObjects)
describes the current selection for the given control
Definition: AppView.cxx:312
virtual void copy() override
Definition: AppView.cxx:219
std::unique_ptr< weld::TreeIter > getEntry(const Point &rPosPixel) const
Definition: AppView.cxx:376
ChildFocusState getChildFocus() const
Definition: AppView.cxx:161
OApplicationSwapWindow * getPanel() const
get the left panel
Definition: AppView.hxx:125
virtual bool isCutAllowed() override
Definition: AppView.cxx:207
VclPtr< OAppBorderWindow > m_pWin
Definition: AppView.hxx:78
bool isLeaf(const weld::TreeView &rTreeView, const weld::TreeIter &rEntry) const
returns if an entry is a leaf
Definition: AppView.cxx:246
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
Definition: AppView.cxx:130
virtual ~OApplicationView() override
Definition: AppView.cxx:104
void setTaskExternalMnemonics(MnemonicGenerator const &_rMnemonics)
automatically creates mnemonics for the texts in our task pane
Definition: AppView.cxx:124
OUString eType
Definition: generalpage.cxx:78
class SAL_NO_VTABLE XPropertySet