update dev300-m58
[ooovba.git] / dbaccess / source / ui / app / AppView.cxx
blob01fa100b46126e3bbc1efa6aa011fe64eca84454
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: AppView.cxx,v $
10 * $Revision: 1.22.6.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_dbaccess.hxx"
33 #ifndef DBAUI_APPVIEW_HXX
34 #include "AppView.hxx"
35 #endif
36 #ifndef _DBU_APP_HRC_
37 #include "dbu_app.hrc"
38 #endif
39 #ifndef _TOOLS_DEBUG_HXX
40 #include <tools/debug.hxx>
41 #endif
42 #ifndef TOOLS_DIAGNOSE_EX_H
43 #include <tools/diagnose_ex.h>
44 #endif
45 #ifndef _DBA_DBACCESS_HELPID_HRC_
46 #include "dbaccess_helpid.hrc"
47 #endif
48 #ifndef _SV_TOOLBOX_HXX
49 #include <vcl/toolbox.hxx>
50 #endif
51 #ifndef _UTL_CONFIGMGR_HXX_
52 #include <unotools/configmgr.hxx>
53 #endif
54 #ifndef _SV_WAITOBJ_HXX
55 #include <vcl/waitobj.hxx>
56 #endif
57 #ifndef _COMPHELPER_TYPES_HXX_
58 #include <comphelper/types.hxx>
59 #endif
60 #ifndef _COM_SUN_STAR_DATATRANSFER_CLIPBOARD_XCLIPBOARD_HPP_
61 #include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
62 #endif
63 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
64 #include <com/sun/star/beans/XPropertySet.hpp>
65 #endif
66 #ifndef _COM_SUN_STAR_SDBCX_XTABLESSUPPLIER_HPP_
67 #include <com/sun/star/sdbcx/XTablesSupplier.hpp>
68 #endif
69 #ifndef _COM_SUN_STAR_SDB_XQUERIESSUPPLIER_HPP_
70 #include <com/sun/star/sdb/XQueriesSupplier.hpp>
71 #endif
72 #ifndef INCLUDED_SVTOOLS_SYSLOCALE_HXX
73 #include <svtools/syslocale.hxx>
74 #endif
75 #ifndef DBAUI_TOOLS_HXX
76 #include "UITools.hxx"
77 #endif
78 #ifndef DBAUI_APPDETAILVIEW_HXX
79 #include "AppDetailView.hxx"
80 #endif
81 #ifndef _DBAUI_TABLETREE_HXX_
82 #include "tabletree.hxx"
83 #endif
84 #ifndef DBAUI_APPSWAPWINDOW_HXX
85 #include "AppSwapWindow.hxx"
86 #endif
87 #ifndef _SV_SVAPP_HXX //autogen
88 #include <vcl/svapp.hxx>
89 #endif
90 #ifndef DBAUI_APPSWAPWINDOW_HXX
91 #include "AppSwapWindow.hxx"
92 #endif
93 #ifndef DBAUI_TITLE_WINDOW_HXX
94 #include "AppTitleWindow.hxx"
95 #endif
96 #ifndef _DBAUI_DSNTYPES_HXX_
97 #include "dsntypes.hxx"
98 #endif
99 #ifndef DBACCESS_SHARED_DBUSTRINGS_HRC
100 #include "dbustrings.hrc"
101 #endif
102 #ifndef DBAUI_ICONTROLLER_HXX
103 #include "IController.hxx"
104 #endif
105 #ifndef DBACCESS_UI_BROWSER_ID_HXX
106 #include "browserids.hxx"
107 #endif
108 #ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX
109 #include <svtools/pathoptions.hxx>
110 #endif
111 #include "IApplicationController.hxx"
113 using namespace ::dbaui;
114 using namespace ::com::sun::star::uno;
115 using namespace ::com::sun::star::ucb;
116 using namespace ::com::sun::star::beans;
117 using namespace ::com::sun::star::sdb;
118 using namespace ::com::sun::star::sdbc;
119 using namespace ::com::sun::star::sdbcx;
120 using namespace ::com::sun::star::datatransfer::clipboard;
121 using namespace ::com::sun::star::lang;
122 using namespace ::com::sun::star::beans;
123 using namespace ::com::sun::star::frame;
124 using namespace ::com::sun::star::container;
125 using ::com::sun::star::sdb::application::NamedDatabaseObject;
127 //==================================================================
128 // class OAppBorderWindow
129 DBG_NAME(OAppBorderWindow)
130 //==================================================================
131 OAppBorderWindow::OAppBorderWindow(OApplicationView* _pParent,PreviewMode _ePreviewMode) : Window(_pParent,WB_DIALOGCONTROL)
132 ,m_pPanel(NULL)
133 ,m_pDetailView(NULL)
134 ,m_pView(_pParent)
136 DBG_CTOR(OAppBorderWindow,NULL);
138 SetBorderStyle(WINDOW_BORDER_MONO);
140 m_pPanel = new OTitleWindow(this,STR_DATABASE,WB_BORDER | WB_DIALOGCONTROL ,FALSE);
141 m_pPanel->SetBorderStyle(WINDOW_BORDER_MONO);
142 OApplicationSwapWindow* pSwap = new OApplicationSwapWindow( m_pPanel, *this );
143 pSwap->Show();
144 pSwap->SetUniqueId(UID_APP_SWAP_VIEW);
146 m_pPanel->setChildWindow(pSwap);
147 m_pPanel->SetUniqueId(UID_APP_DATABASE_VIEW);
148 m_pPanel->Show();
150 m_pDetailView = new OApplicationDetailView(*this,_ePreviewMode);
151 m_pDetailView->Show();
153 ImplInitSettings();
155 // -----------------------------------------------------------------------------
156 OAppBorderWindow::~OAppBorderWindow()
158 //////////////////////////////////////////////////////////////////////
159 // Childs zerstoeren
160 if ( m_pPanel )
162 m_pPanel->Hide();
163 ::std::auto_ptr<Window> aTemp(m_pPanel);
164 m_pPanel = NULL;
166 if ( m_pDetailView )
168 m_pDetailView->Hide();
169 ::std::auto_ptr<Window> aTemp(m_pDetailView);
170 m_pDetailView = NULL;
173 DBG_DTOR(OAppBorderWindow,NULL);
175 // -----------------------------------------------------------------------------
176 void OAppBorderWindow::GetFocus()
178 if ( m_pPanel )
179 m_pPanel->GrabFocus();
181 // -----------------------------------------------------------------------------
182 void OAppBorderWindow::Resize()
184 //////////////////////////////////////////////////////////////////////
185 // Abmessungen parent window
186 Size aOutputSize( GetOutputSize() );
187 long nOutputWidth = aOutputSize.Width();
188 long nOutputHeight = aOutputSize.Height();
189 long nX = 0;
191 Size aFLSize = LogicToPixel( Size( 3, 8 ), MAP_APPFONT );
192 if ( m_pPanel )
194 OApplicationSwapWindow* pSwap = getPanel();
195 if ( pSwap )
197 if ( pSwap->GetEntryCount() != 0 )
198 nX = pSwap->GetBoundingBox( pSwap->GetEntry(0) ).GetWidth() + aFLSize.Height();
200 nX = ::std::max(m_pPanel->GetWidthPixel() ,nX);
201 m_pPanel->SetPosSizePixel(Point(0,0),Size(nX,nOutputHeight));
204 if ( m_pDetailView )
205 m_pDetailView->SetPosSizePixel(Point(nX + aFLSize.Width(),0),Size(nOutputWidth - nX - aFLSize.Width(),nOutputHeight));
207 // -----------------------------------------------------------------------------
208 void OAppBorderWindow::DataChanged( const DataChangedEvent& rDCEvt )
210 Window::DataChanged( rDCEvt );
212 if ( (rDCEvt.GetType() == DATACHANGED_FONTS) ||
213 (rDCEvt.GetType() == DATACHANGED_DISPLAY) ||
214 (rDCEvt.GetType() == DATACHANGED_FONTSUBSTITUTION) ||
215 ((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
216 (rDCEvt.GetFlags() & SETTINGS_STYLE)) )
218 ImplInitSettings();
219 Invalidate();
222 // -----------------------------------------------------------------------------
223 void OAppBorderWindow::ImplInitSettings()
225 const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
226 if( true )
228 Font aFont;
229 aFont = rStyleSettings.GetFieldFont();
230 aFont.SetColor( rStyleSettings.GetWindowTextColor() );
231 SetPointFont( aFont );
234 if( true )
236 SetTextColor( rStyleSettings.GetFieldTextColor() );
237 SetTextFillColor();
240 if( true )
241 SetBackground( rStyleSettings.GetDialogColor() );
243 /*SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetDialogColor() ) );
244 SetFillColor( Application::GetSettings().GetStyleSettings().GetDialogColor() );
245 SetTextFillColor( Application::GetSettings().GetStyleSettings().GetDialogColor() );*/
247 // -----------------------------------------------------------------------------
248 OApplicationView* OAppBorderWindow::getView() const
250 return m_pView;
253 // -----------------------------------------------------------------------------
254 OApplicationSwapWindow* OAppBorderWindow::getPanel() const
256 return static_cast< OApplicationSwapWindow* >( m_pPanel->getChildWindow() );
259 // -----------------------------------------------------------------------------
260 OApplicationDetailView* OAppBorderWindow::getDetailView() const
262 return m_pDetailView;
265 //==================================================================
266 // class OApplicationView
267 //==================================================================
268 DBG_NAME(OApplicationView);
269 //------------------------------------------------------------------------------
270 OApplicationView::OApplicationView( Window* pParent
271 ,const Reference< XMultiServiceFactory >& _rxOrb
272 ,IApplicationController& _rAppController
273 ,PreviewMode _ePreviewMode
275 ODataView( pParent, _rAppController, _rxOrb, WB_DIALOGCONTROL )
276 ,m_rAppController( _rAppController )
277 ,m_eChildFocus(NONE)
279 DBG_CTOR(OApplicationView,NULL);
283 m_aLocale = SvtSysLocale().GetLocaleData().getLocale();
285 catch(Exception&)
289 m_pWin = new OAppBorderWindow(this,_ePreviewMode);
290 m_pWin->SetUniqueId(UID_APP_VIEW_BORDER_WIN);
291 m_pWin->Show();
293 ImplInitSettings();
296 //------------------------------------------------------------------------------
297 OApplicationView::~OApplicationView()
299 DBG_DTOR(OApplicationView,NULL);
302 stopComponentListening(m_xObject);
303 m_pWin->Hide();
304 ::std::auto_ptr<Window> aTemp(m_pWin);
305 m_pWin = NULL;
308 // -----------------------------------------------------------------------------
309 void OApplicationView::createIconAutoMnemonics( MnemonicGenerator& _rMnemonics )
311 if ( m_pWin && m_pWin->getPanel() )
312 m_pWin->getPanel()->createIconAutoMnemonics( _rMnemonics );
315 // -----------------------------------------------------------------------------
316 void OApplicationView::setTaskExternalMnemonics( MnemonicGenerator& _rMnemonics )
318 if ( m_pWin && m_pWin->getDetailView() )
319 m_pWin->getDetailView()->setTaskExternalMnemonics( _rMnemonics );
322 // -----------------------------------------------------------------------------
323 void OApplicationView::DataChanged( const DataChangedEvent& rDCEvt )
325 ODataView::DataChanged( rDCEvt );
327 if ( (rDCEvt.GetType() == DATACHANGED_FONTS) ||
328 (rDCEvt.GetType() == DATACHANGED_DISPLAY) ||
329 (rDCEvt.GetType() == DATACHANGED_FONTSUBSTITUTION) ||
330 ((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
331 (rDCEvt.GetFlags() & SETTINGS_STYLE)) )
333 ImplInitSettings();
334 Invalidate();
337 //------------------------------------------------------------------------------
338 void OApplicationView::resizeDocumentView(Rectangle& _rPlayground)
340 if ( m_pWin && !_rPlayground.IsEmpty() )
342 Size aFLSize = LogicToPixel( Size( 3, 3 ), MAP_APPFONT );
343 _rPlayground.Move( aFLSize.A(),aFLSize.B() );
344 Size aOldSize = _rPlayground.GetSize();
345 _rPlayground.SetSize( Size(aOldSize.A() - 2*aFLSize.A(), aOldSize.B() - 2*aFLSize.B()) );
347 m_pWin->SetPosSizePixel(_rPlayground.TopLeft() , _rPlayground.GetSize() );
349 // just for completeness: there is no space left, we occupied it all ...
350 _rPlayground.SetPos( _rPlayground.BottomRight() );
351 _rPlayground.SetSize( Size( 0, 0 ) );
353 //------------------------------------------------------------------------------
354 long OApplicationView::PreNotify( NotifyEvent& rNEvt )
356 switch(rNEvt.GetType())
358 case EVENT_GETFOCUS:
359 if( m_pWin && getPanel() && getPanel()->HasChildPathFocus() )
360 m_eChildFocus = PANELSWAP;
361 else if ( m_pWin && getDetailView() && getDetailView()->HasChildPathFocus() )
362 m_eChildFocus = DETAIL;
363 else
364 m_eChildFocus = NONE;
365 break;
366 case EVENT_KEYINPUT:
368 const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent();
369 // give the pane the chance to intercept mnemonic accelerators
370 // #i34790# - 2004-09-30 - fs@openoffice.org
371 if ( getPanel() && getPanel()->interceptKeyInput( *pKeyEvent ) )
372 return 1L;
373 // and ditto the detail view
374 // #i72799# - 2006-12-20 / frank.schoenheit@sun.com
375 if ( getDetailView() && getDetailView()->interceptKeyInput( *pKeyEvent ) )
376 return 1L;
378 break;
381 return ODataView::PreNotify(rNEvt);
383 // -----------------------------------------------------------------------------
384 IClipboardTest* OApplicationView::getActiveChild() const
386 IClipboardTest* pTest = NULL;
387 if ( DETAIL == m_eChildFocus )
388 pTest = getDetailView();
389 return pTest;
391 // -----------------------------------------------------------------------------
392 sal_Bool OApplicationView::isCopyAllowed()
394 IClipboardTest* pTest = getActiveChild();
395 return pTest && pTest->isCopyAllowed();
397 // -----------------------------------------------------------------------------
398 sal_Bool OApplicationView::isCutAllowed()
400 IClipboardTest* pTest = getActiveChild();
401 return pTest && pTest->isCutAllowed();
403 // -----------------------------------------------------------------------------
404 sal_Bool OApplicationView::isPasteAllowed()
406 IClipboardTest* pTest = getActiveChild();
407 return pTest && pTest->isPasteAllowed();
409 // -----------------------------------------------------------------------------
410 void OApplicationView::copy()
412 IClipboardTest* pTest = getActiveChild();
413 if ( pTest )
414 pTest->copy();
416 // -----------------------------------------------------------------------------
417 void OApplicationView::cut()
419 IClipboardTest* pTest = getActiveChild();
420 if ( pTest )
421 pTest->cut();
423 // -----------------------------------------------------------------------------
424 void OApplicationView::paste()
426 IClipboardTest* pTest = getActiveChild();
427 if ( pTest )
428 pTest->paste();
430 // -----------------------------------------------------------------------------
431 ::rtl::OUString OApplicationView::getQualifiedName( SvLBoxEntry* _pEntry ) const
433 OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
434 return getDetailView()->getQualifiedName( _pEntry );
436 // -----------------------------------------------------------------------------
437 sal_Bool OApplicationView::isLeaf(SvLBoxEntry* _pEntry) const
439 OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
440 return getDetailView()->isLeaf(_pEntry);
442 // -----------------------------------------------------------------------------
443 sal_Bool OApplicationView::isALeafSelected() const
445 OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
446 return getDetailView()->isALeafSelected();
448 // -----------------------------------------------------------------------------
449 void OApplicationView::selectAll()
451 OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
452 getDetailView()->selectAll();
454 // -----------------------------------------------------------------------------
455 sal_Bool OApplicationView::isSortUp() const
457 OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
458 return getDetailView()->isSortUp();
460 // -----------------------------------------------------------------------------
461 void OApplicationView::sortDown()
463 OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
464 getDetailView()->sortDown();
466 // -----------------------------------------------------------------------------
467 void OApplicationView::sortUp()
469 OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
470 getDetailView()->sortUp();
472 // -----------------------------------------------------------------------------
473 sal_Bool OApplicationView::isFilled() const
475 OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
476 return getDetailView()->isFilled();
478 // -----------------------------------------------------------------------------
479 ElementType OApplicationView::getElementType() const
481 OSL_ENSURE(m_pWin && getDetailView() && getPanel(),"Detail view is NULL! -> GPF");
482 return getDetailView()->HasChildPathFocus() ? getDetailView()->getElementType() : getPanel()->getElementType();
484 // -----------------------------------------------------------------------------
485 sal_Int32 OApplicationView::getSelectionCount()
487 OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
488 return getDetailView()->getSelectionCount();
490 // -----------------------------------------------------------------------------
491 sal_Int32 OApplicationView::getElementCount()
493 OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
494 return getDetailView()->getElementCount();
496 // -----------------------------------------------------------------------------
497 void OApplicationView::getSelectionElementNames( ::std::vector< ::rtl::OUString>& _rNames ) const
499 OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
500 getDetailView()->getSelectionElementNames( _rNames );
502 // -----------------------------------------------------------------------------
503 void OApplicationView::describeCurrentSelectionForControl( const Control& _rControl, Sequence< NamedDatabaseObject >& _out_rSelectedObjects )
505 OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
506 getDetailView()->describeCurrentSelectionForControl( _rControl, _out_rSelectedObjects );
508 // -----------------------------------------------------------------------------
509 void OApplicationView::describeCurrentSelectionForType( const ElementType _eType, Sequence< NamedDatabaseObject >& _out_rSelectedObjects )
511 OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
512 getDetailView()->describeCurrentSelectionForType( _eType, _out_rSelectedObjects );
514 // -----------------------------------------------------------------------------
515 void OApplicationView::selectElements(const Sequence< ::rtl::OUString>& _aNames)
517 OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
518 getDetailView()->selectElements( _aNames );
520 // -----------------------------------------------------------------------------
521 SvLBoxEntry* OApplicationView::elementAdded(ElementType eType,const ::rtl::OUString& _rName, const Any& _rObject )
523 OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
524 return getDetailView()->elementAdded(eType,_rName,_rObject);
526 // -----------------------------------------------------------------------------
527 void OApplicationView::elementRemoved(ElementType eType,const ::rtl::OUString& _rName )
529 OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
530 getDetailView()->elementRemoved(eType,_rName);
532 // -----------------------------------------------------------------------------
533 void OApplicationView::elementReplaced(ElementType _eType
534 ,const ::rtl::OUString& _rOldName
535 ,const ::rtl::OUString& _rNewName )
537 OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
538 getDetailView()->elementReplaced(_eType, _rOldName, _rNewName );
540 // -----------------------------------------------------------------------------
541 void OApplicationView::clearPages(sal_Bool _bTaskAlso)
543 OSL_ENSURE(m_pWin && getDetailView() && getPanel(),"Detail view is NULL! -> GPF");
544 getPanel()->clearSelection();
545 getDetailView()->clearPages(_bTaskAlso);
547 // -----------------------------------------------------------------------------
548 void OApplicationView::selectContainer(ElementType _eType)
550 OSL_ENSURE(m_pWin && getPanel(),"Detail view is NULL! -> GPF");
551 WaitObject aWO(this);
552 getPanel()->selectContainer(_eType);
554 // -----------------------------------------------------------------------------
555 SvLBoxEntry* OApplicationView::getEntry( const Point& _aPosPixel ) const
557 OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
558 return getDetailView()->getEntry(_aPosPixel);
560 // -----------------------------------------------------------------------------
561 PreviewMode OApplicationView::getPreviewMode()
563 OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
564 return getDetailView()->getPreviewMode();
566 // -----------------------------------------------------------------------------
567 sal_Bool OApplicationView::isPreviewEnabled()
569 OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
570 return getDetailView()->isPreviewEnabled();
572 // -----------------------------------------------------------------------------
573 void OApplicationView::switchPreview(PreviewMode _eMode)
575 OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
576 getDetailView()->switchPreview(_eMode);
578 // -----------------------------------------------------------------------------
579 void OApplicationView::showPreview(const Reference< XContent >& _xContent)
581 OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
582 stopComponentListening(m_xObject);
583 m_xObject = NULL;
584 getDetailView()->showPreview(_xContent);
586 // -----------------------------------------------------------------------------
587 void OApplicationView::showPreview( const ::rtl::OUString& _sDataSourceName,
588 const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection,
589 const ::rtl::OUString& _sName,
590 sal_Bool _bTable)
592 OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
593 if ( isPreviewEnabled() )
595 stopComponentListening(m_xObject);
596 m_xObject = NULL;
599 Reference<XNameAccess> xNameAccess;
600 if ( _bTable )
602 Reference<XTablesSupplier> xSup(_xConnection,UNO_QUERY);
603 if ( xSup.is() )
604 xNameAccess.set(xSup->getTables(),UNO_QUERY);
606 else
608 Reference<XQueriesSupplier> xSup(_xConnection,UNO_QUERY);
609 if ( xSup.is() )
610 xNameAccess.set(xSup->getQueries(),UNO_QUERY);
612 if ( xNameAccess.is() && xNameAccess->hasByName(_sName) )
613 m_xObject.set(xNameAccess->getByName(_sName),UNO_QUERY);
615 catch( const Exception& )
617 DBG_UNHANDLED_EXCEPTION();
619 if ( m_xObject.is() )
620 startComponentListening(m_xObject);
621 getDetailView()->showPreview(_sDataSourceName,_sName,_bTable);
624 // -----------------------------------------------------------------------------
625 void OApplicationView::GetFocus()
627 if ( m_eChildFocus == NONE && m_pWin )
629 m_pWin->GrabFocus();
632 // -----------------------------------------------------------------------------
633 void OApplicationView::_disposing( const ::com::sun::star::lang::EventObject& /*_rSource*/ )
635 if ( m_pWin && getDetailView() )
636 showPreview(NULL);
638 // -----------------------------------------------------------------------------
639 void OApplicationView::ImplInitSettings()
641 const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
642 if( true )
644 Font aFont;
645 aFont = rStyleSettings.GetFieldFont();
646 aFont.SetColor( rStyleSettings.GetWindowTextColor() );
647 SetPointFont( aFont );
650 if( true )
652 SetTextColor( rStyleSettings.GetFieldTextColor() );
653 SetTextFillColor();
656 if( true )
657 SetBackground( rStyleSettings.GetFieldColor() );
658 /*SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetDialogColor() ) );
659 SetFillColor( Application::GetSettings().GetStyleSettings().GetDialogColor() );
660 SetTextFillColor( Application::GetSettings().GetStyleSettings().GetDialogColor() );*/
662 //-----------------------------------------------------------------------------