1*96de5490SAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*96de5490SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*96de5490SAndrew Rist * or more contributor license agreements. See the NOTICE file
5*96de5490SAndrew Rist * distributed with this work for additional information
6*96de5490SAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*96de5490SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*96de5490SAndrew Rist * "License"); you may not use this file except in compliance
9*96de5490SAndrew Rist * with the License. You may obtain a copy of the License at
10cdf0e10cSrcweir *
11*96de5490SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir *
13*96de5490SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*96de5490SAndrew Rist * software distributed under the License is distributed on an
15*96de5490SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*96de5490SAndrew Rist * KIND, either express or implied. See the License for the
17*96de5490SAndrew Rist * specific language governing permissions and limitations
18*96de5490SAndrew Rist * under the License.
19cdf0e10cSrcweir *
20*96de5490SAndrew Rist *************************************************************/
21*96de5490SAndrew Rist
22*96de5490SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_dbaccess.hxx"
26cdf0e10cSrcweir #ifndef DBAUI_APPDETAILVIEW_HXX
27cdf0e10cSrcweir #include "AppDetailView.hxx"
28cdf0e10cSrcweir #endif
29cdf0e10cSrcweir #ifndef _TOOLS_DEBUG_HXX
30cdf0e10cSrcweir #include <tools/debug.hxx>
31cdf0e10cSrcweir #endif
32cdf0e10cSrcweir #ifndef _DBA_DBACCESS_HELPID_HRC_
33cdf0e10cSrcweir #include "dbaccess_helpid.hrc"
34cdf0e10cSrcweir #endif
35cdf0e10cSrcweir #ifndef _DBU_APP_HRC_
36cdf0e10cSrcweir #include "dbu_app.hrc"
37cdf0e10cSrcweir #endif
38cdf0e10cSrcweir #ifndef DBAUI_APPVIEW_HXX
39cdf0e10cSrcweir #include "AppView.hxx"
40cdf0e10cSrcweir #endif
41cdf0e10cSrcweir #ifndef _COM_SUN_STAR_UI_XUICONFIGURATIONMANAGER_HPP_
42cdf0e10cSrcweir #include <com/sun/star/ui/XUIConfigurationManager.hpp>
43cdf0e10cSrcweir #endif
44cdf0e10cSrcweir #ifndef _COM_SUN_STAR_UI_XMODULEUICONFIGURATIONMANAGERSUPPLIER_HPP_
45cdf0e10cSrcweir #include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
46cdf0e10cSrcweir #endif
47cdf0e10cSrcweir #ifndef _COM_SUN_STAR_UI_XIMAGEMANAGER_HPP_
48cdf0e10cSrcweir #include <com/sun/star/ui/XImageManager.hpp>
49cdf0e10cSrcweir #endif
50cdf0e10cSrcweir #ifndef _COM_SUN_STAR_UI_IMAGETYPE_HPP_
51cdf0e10cSrcweir #include <com/sun/star/ui/ImageType.hpp>
52cdf0e10cSrcweir #endif
53cdf0e10cSrcweir #ifndef _COM_SUN_STAR_SDBCX_XVIEWSSUPPLIER_HPP_
54cdf0e10cSrcweir #include <com/sun/star/sdbcx/XViewsSupplier.hpp>
55cdf0e10cSrcweir #endif
56cdf0e10cSrcweir #ifndef _COM_SUN_STAR_GRAPHIC_XGRAPHIC_HPP_
57cdf0e10cSrcweir #include <com/sun/star/graphic/XGraphic.hpp>
58cdf0e10cSrcweir #endif
59cdf0e10cSrcweir #ifndef _COM_SUN_STAR_UTIL_URL_HPP_
60cdf0e10cSrcweir #include <com/sun/star/util/URL.hpp>
61cdf0e10cSrcweir #endif
62cdf0e10cSrcweir #ifndef _DBAUI_LISTVIEWITEMS_HXX_
63cdf0e10cSrcweir #include "listviewitems.hxx"
64cdf0e10cSrcweir #endif
65cdf0e10cSrcweir #ifndef _IMAGE_HXX //autogen
66cdf0e10cSrcweir #include <vcl/image.hxx>
67cdf0e10cSrcweir #endif
68cdf0e10cSrcweir #ifndef _SV_MNEMONIC_HXX
69cdf0e10cSrcweir #include <vcl/mnemonic.hxx>
70cdf0e10cSrcweir #endif
71cdf0e10cSrcweir #ifndef _SV_MNEMONIC_HXX
72cdf0e10cSrcweir #include <vcl/mnemonic.hxx>
73cdf0e10cSrcweir #endif
74cdf0e10cSrcweir #ifndef DBACCESS_UI_BROWSER_ID_HXX
75cdf0e10cSrcweir #include "browserids.hxx"
76cdf0e10cSrcweir #endif
77cdf0e10cSrcweir #ifndef DBAUI_APPDETAILPAGEHELPER_HXX
78cdf0e10cSrcweir #include "AppDetailPageHelper.hxx"
79cdf0e10cSrcweir #endif
80cdf0e10cSrcweir #ifndef _SV_SVAPP_HXX //autogen
81cdf0e10cSrcweir #include <vcl/svapp.hxx>
82cdf0e10cSrcweir #endif
83cdf0e10cSrcweir #ifndef _DBACCESS_UI_CALLBACKS_HXX_
84cdf0e10cSrcweir #include "callbacks.hxx"
85cdf0e10cSrcweir #endif
86cdf0e10cSrcweir #ifndef DBAUI_ICONTROLLER_HXX
87cdf0e10cSrcweir #include "IController.hxx"
88cdf0e10cSrcweir #endif
89cdf0e10cSrcweir #ifndef _DBAUI_MODULE_DBU_HXX_
90cdf0e10cSrcweir #include "moduledbu.hxx"
91cdf0e10cSrcweir #endif
92cdf0e10cSrcweir #ifndef _SVTOOLS_LOCALRESACCESS_HXX_
93cdf0e10cSrcweir #include <svtools/localresaccess.hxx>
94cdf0e10cSrcweir #endif
95cdf0e10cSrcweir #include <algorithm>
96cdf0e10cSrcweir #include "dbtreelistbox.hxx"
97cdf0e10cSrcweir #include "IApplicationController.hxx"
98cdf0e10cSrcweir #include "imageprovider.hxx"
99cdf0e10cSrcweir
100cdf0e10cSrcweir using namespace ::dbaui;
101cdf0e10cSrcweir using namespace ::com::sun::star::uno;
102cdf0e10cSrcweir using namespace ::com::sun::star::sdbc;
103cdf0e10cSrcweir using namespace ::com::sun::star::sdbcx;
104cdf0e10cSrcweir using namespace ::com::sun::star::lang;
105cdf0e10cSrcweir using namespace ::com::sun::star::ucb;
106cdf0e10cSrcweir using namespace ::com::sun::star::graphic;
107cdf0e10cSrcweir using namespace ::com::sun::star::ui;
108cdf0e10cSrcweir using namespace ::com::sun::star::container;
109cdf0e10cSrcweir using namespace ::com::sun::star::beans;
110cdf0e10cSrcweir using ::com::sun::star::util::URL;
111cdf0e10cSrcweir using ::com::sun::star::sdb::application::NamedDatabaseObject;
112cdf0e10cSrcweir
113cdf0e10cSrcweir #define SPACEBETWEENENTRIES 4
114cdf0e10cSrcweir
115cdf0e10cSrcweir // -----------------------------------------------------------------------------
TaskEntry(const sal_Char * _pAsciiUNOCommand,sal_uInt16 _nHelpID,sal_uInt16 _nTitleResourceID,bool _bHideWhenDisabled)116cdf0e10cSrcweir TaskEntry::TaskEntry( const sal_Char* _pAsciiUNOCommand, sal_uInt16 _nHelpID, sal_uInt16 _nTitleResourceID, bool _bHideWhenDisabled )
117cdf0e10cSrcweir :sUNOCommand( ::rtl::OUString::createFromAscii( _pAsciiUNOCommand ) )
118cdf0e10cSrcweir ,nHelpID( _nHelpID )
119cdf0e10cSrcweir ,sTitle( ModuleRes( _nTitleResourceID ) )
120cdf0e10cSrcweir ,bHideWhenDisabled( _bHideWhenDisabled )
121cdf0e10cSrcweir {
122cdf0e10cSrcweir }
123cdf0e10cSrcweir
124cdf0e10cSrcweir // -----------------------------------------------------------------------------
OCreationList(OTasksWindow & _rParent)125cdf0e10cSrcweir OCreationList::OCreationList( OTasksWindow& _rParent )
126cdf0e10cSrcweir :SvTreeListBox( &_rParent, WB_TABSTOP | WB_HASBUTTONSATROOT | WB_HASBUTTONS )
127cdf0e10cSrcweir ,m_rTaskWindow( _rParent )
128cdf0e10cSrcweir ,m_pMouseDownEntry( NULL )
129cdf0e10cSrcweir ,m_pLastActiveEntry( NULL )
130cdf0e10cSrcweir {
131cdf0e10cSrcweir sal_uInt16 nSize = SPACEBETWEENENTRIES;
132cdf0e10cSrcweir SetSpaceBetweenEntries(nSize);
133cdf0e10cSrcweir SetSelectionMode( NO_SELECTION );
134cdf0e10cSrcweir SetExtendedWinBits( EWB_NO_AUTO_CURENTRY );
135cdf0e10cSrcweir SetNodeDefaultImages( );
136cdf0e10cSrcweir EnableEntryMnemonics();
137cdf0e10cSrcweir }
138cdf0e10cSrcweir // -----------------------------------------------------------------------------
Paint(const Rectangle & _rRect)139cdf0e10cSrcweir void OCreationList::Paint( const Rectangle& _rRect )
140cdf0e10cSrcweir {
141cdf0e10cSrcweir if ( m_pMouseDownEntry )
142cdf0e10cSrcweir m_aOriginalFont = GetFont();
143cdf0e10cSrcweir
144cdf0e10cSrcweir m_aOriginalBackgroundColor = GetBackground().GetColor();
145cdf0e10cSrcweir SvTreeListBox::Paint( _rRect );
146cdf0e10cSrcweir SetBackground( m_aOriginalBackgroundColor );
147cdf0e10cSrcweir
148cdf0e10cSrcweir if ( m_pMouseDownEntry )
149cdf0e10cSrcweir Control::SetFont( m_aOriginalFont );
150cdf0e10cSrcweir }
151cdf0e10cSrcweir
152cdf0e10cSrcweir // -----------------------------------------------------------------------------
PreparePaint(SvLBoxEntry * _pEntry)153cdf0e10cSrcweir void OCreationList::PreparePaint( SvLBoxEntry* _pEntry )
154cdf0e10cSrcweir {
155cdf0e10cSrcweir Wallpaper aEntryBackground( m_aOriginalBackgroundColor );
156cdf0e10cSrcweir if ( _pEntry )
157cdf0e10cSrcweir {
158cdf0e10cSrcweir if ( _pEntry == GetCurEntry() )
159cdf0e10cSrcweir {
160cdf0e10cSrcweir // draw a selection background
161cdf0e10cSrcweir bool bIsMouseDownEntry = ( _pEntry == m_pMouseDownEntry );
162cdf0e10cSrcweir DrawSelectionBackground( GetBoundingRect( _pEntry ), bIsMouseDownEntry ? 1 : 2, sal_False, sal_True, sal_False );
163cdf0e10cSrcweir
164cdf0e10cSrcweir if ( bIsMouseDownEntry )
165cdf0e10cSrcweir {
166cdf0e10cSrcweir Font aFont( GetFont() );
167cdf0e10cSrcweir aFont.SetColor( GetSettings().GetStyleSettings().GetHighlightTextColor() );
168cdf0e10cSrcweir Control::SetFont( aFont );
169cdf0e10cSrcweir }
170cdf0e10cSrcweir
171cdf0e10cSrcweir // and temporary set a transparent background, for all the other
172cdf0e10cSrcweir // paint operations the SvTreeListBox is going to do
173cdf0e10cSrcweir aEntryBackground = Wallpaper( Color( COL_TRANSPARENT ) );
174cdf0e10cSrcweir }
175cdf0e10cSrcweir }
176cdf0e10cSrcweir
177cdf0e10cSrcweir SetBackground( aEntryBackground );
178cdf0e10cSrcweir }
179cdf0e10cSrcweir
180cdf0e10cSrcweir // -----------------------------------------------------------------------------
SelectSearchEntry(const void * _pEntry)181cdf0e10cSrcweir void OCreationList::SelectSearchEntry( const void* _pEntry )
182cdf0e10cSrcweir {
183cdf0e10cSrcweir SvLBoxEntry* pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( _pEntry ) );
184cdf0e10cSrcweir DBG_ASSERT( pEntry, "OCreationList::SelectSearchEntry: invalid entry!" );
185cdf0e10cSrcweir
186cdf0e10cSrcweir if ( pEntry )
187cdf0e10cSrcweir setCurrentEntryInvalidate( pEntry );
188cdf0e10cSrcweir
189cdf0e10cSrcweir if ( !HasChildPathFocus() )
190cdf0e10cSrcweir GrabFocus();
191cdf0e10cSrcweir }
192cdf0e10cSrcweir
193cdf0e10cSrcweir // -----------------------------------------------------------------------------
ExecuteSearchEntry(const void * _pEntry) const194cdf0e10cSrcweir void OCreationList::ExecuteSearchEntry( const void* _pEntry ) const
195cdf0e10cSrcweir {
196cdf0e10cSrcweir SvLBoxEntry* pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( _pEntry ) );
197cdf0e10cSrcweir DBG_ASSERT( pEntry, "OCreationList::ExecuteSearchEntry: invalid entry!" );
198cdf0e10cSrcweir DBG_ASSERT( pEntry == GetCurEntry(), "OCreationList::ExecuteSearchEntry: SelectSearchEntry should have been called before!" );
199cdf0e10cSrcweir
200cdf0e10cSrcweir if ( pEntry )
201cdf0e10cSrcweir onSelected( pEntry );
202cdf0e10cSrcweir }
203cdf0e10cSrcweir
204cdf0e10cSrcweir // -----------------------------------------------------------------------------
GetFocusRect(SvLBoxEntry * _pEntry,long _nLine)205cdf0e10cSrcweir Rectangle OCreationList::GetFocusRect( SvLBoxEntry* _pEntry, long _nLine )
206cdf0e10cSrcweir {
207cdf0e10cSrcweir Rectangle aRect = SvTreeListBox::GetFocusRect( _pEntry, _nLine );
208cdf0e10cSrcweir aRect.Left() = 0;
209cdf0e10cSrcweir
210cdf0e10cSrcweir // try to let the focus rect start before the bitmap item - this looks better
211cdf0e10cSrcweir SvLBoxItem* pBitmapItem = _pEntry->GetFirstItem( SV_ITEM_ID_LBOXCONTEXTBMP );
212cdf0e10cSrcweir SvLBoxTab* pTab = pBitmapItem ? GetTab( _pEntry, pBitmapItem ) : NULL;
213cdf0e10cSrcweir SvViewDataItem* pItemData = pBitmapItem ? GetViewDataItem( _pEntry, pBitmapItem ) : NULL;
214cdf0e10cSrcweir DBG_ASSERT( pTab && pItemData, "OCreationList::GetFocusRect: could not find the first bitmap item!" );
215cdf0e10cSrcweir if ( pTab && pItemData )
216cdf0e10cSrcweir aRect.Left() = pTab->GetPos() - pItemData->aSize.Width() / 2;
217cdf0e10cSrcweir
218cdf0e10cSrcweir // inflate the rectangle a little bit - looks better, too
219cdf0e10cSrcweir aRect.Left() = ::std::max< long >( 0, aRect.Left() - 2 );
220cdf0e10cSrcweir aRect.Right() = ::std::min< long >( GetOutputSizePixel().Width() - 1, aRect.Right() + 2 );
221cdf0e10cSrcweir
222cdf0e10cSrcweir return aRect;
223cdf0e10cSrcweir }
224cdf0e10cSrcweir // -----------------------------------------------------------------------------
StartDrag(sal_Int8,const Point &)225cdf0e10cSrcweir void OCreationList::StartDrag( sal_Int8 /*_nAction*/, const Point& /*_rPosPixel*/ )
226cdf0e10cSrcweir {
227cdf0e10cSrcweir // don't give this to the base class, it does a ReleaseMouse as very first action
228cdf0e10cSrcweir // Though I think this is a bug (it should ReleaseMouse only if it is going to do
229cdf0e10cSrcweir // something with the drag-event), I hesitate to fix it in the current state,
230cdf0e10cSrcweir // since I don't overlook the consequences, and we're close to 2.0 ...)
231cdf0e10cSrcweir }
232cdf0e10cSrcweir // -----------------------------------------------------------------------------
ModelHasCleared()233cdf0e10cSrcweir void OCreationList::ModelHasCleared()
234cdf0e10cSrcweir {
235cdf0e10cSrcweir SvTreeListBox::ModelHasCleared();
236cdf0e10cSrcweir m_pLastActiveEntry = NULL;
237cdf0e10cSrcweir m_pMouseDownEntry = NULL;
238cdf0e10cSrcweir }
239cdf0e10cSrcweir // -----------------------------------------------------------------------------
GetFocus()240cdf0e10cSrcweir void OCreationList::GetFocus()
241cdf0e10cSrcweir {
242cdf0e10cSrcweir SvTreeListBox::GetFocus();
243cdf0e10cSrcweir if ( !GetCurEntry() )
244cdf0e10cSrcweir setCurrentEntryInvalidate( m_pLastActiveEntry ? m_pLastActiveEntry : GetFirstEntryInView() );
245cdf0e10cSrcweir }
246cdf0e10cSrcweir // -----------------------------------------------------------------------------
LoseFocus()247cdf0e10cSrcweir void OCreationList::LoseFocus()
248cdf0e10cSrcweir {
249cdf0e10cSrcweir SvTreeListBox::LoseFocus();
250cdf0e10cSrcweir m_pLastActiveEntry = GetCurEntry();
251cdf0e10cSrcweir setCurrentEntryInvalidate( NULL );
252cdf0e10cSrcweir }
253cdf0e10cSrcweir // -----------------------------------------------------------------------------
MouseButtonDown(const MouseEvent & rMEvt)254cdf0e10cSrcweir void OCreationList::MouseButtonDown( const MouseEvent& rMEvt )
255cdf0e10cSrcweir {
256cdf0e10cSrcweir SvTreeListBox::MouseButtonDown( rMEvt );
257cdf0e10cSrcweir
258cdf0e10cSrcweir DBG_ASSERT( !m_pMouseDownEntry, "OCreationList::MouseButtonDown: I missed some mouse event!" );
259cdf0e10cSrcweir m_pMouseDownEntry = GetCurEntry();
260cdf0e10cSrcweir if ( m_pMouseDownEntry )
261cdf0e10cSrcweir {
262cdf0e10cSrcweir InvalidateEntry( m_pMouseDownEntry );
263cdf0e10cSrcweir CaptureMouse();
264cdf0e10cSrcweir }
265cdf0e10cSrcweir }
266cdf0e10cSrcweir // -----------------------------------------------------------------------------
MouseMove(const MouseEvent & rMEvt)267cdf0e10cSrcweir void OCreationList::MouseMove( const MouseEvent& rMEvt )
268cdf0e10cSrcweir {
269cdf0e10cSrcweir if ( rMEvt.IsLeaveWindow() )
270cdf0e10cSrcweir {
271cdf0e10cSrcweir setCurrentEntryInvalidate( NULL );
272cdf0e10cSrcweir }
273cdf0e10cSrcweir else if ( !rMEvt.IsSynthetic() )
274cdf0e10cSrcweir {
275cdf0e10cSrcweir SvLBoxEntry* pEntry = GetEntry( rMEvt.GetPosPixel() );
276cdf0e10cSrcweir
277cdf0e10cSrcweir if ( m_pMouseDownEntry )
278cdf0e10cSrcweir {
279cdf0e10cSrcweir // we're currently in a "mouse down" phase
280cdf0e10cSrcweir DBG_ASSERT( IsMouseCaptured(), "OCreationList::MouseMove: inconsistence (1)!" );
281cdf0e10cSrcweir if ( pEntry == m_pMouseDownEntry )
282cdf0e10cSrcweir {
283cdf0e10cSrcweir setCurrentEntryInvalidate( m_pMouseDownEntry );
284cdf0e10cSrcweir }
285cdf0e10cSrcweir else
286cdf0e10cSrcweir {
287cdf0e10cSrcweir DBG_ASSERT( ( GetCurEntry() == m_pMouseDownEntry ) || !GetCurEntry(),
288cdf0e10cSrcweir "OCreationList::MouseMove: inconsistence (2)!" );
289cdf0e10cSrcweir setCurrentEntryInvalidate( NULL );
290cdf0e10cSrcweir }
291cdf0e10cSrcweir }
292cdf0e10cSrcweir else
293cdf0e10cSrcweir {
294cdf0e10cSrcweir // the user is simply hovering with the mouse
295cdf0e10cSrcweir if ( setCurrentEntryInvalidate( pEntry ) )
296cdf0e10cSrcweir {
297cdf0e10cSrcweir if ( !m_pMouseDownEntry )
298cdf0e10cSrcweir updateHelpText();
299cdf0e10cSrcweir }
300cdf0e10cSrcweir }
301cdf0e10cSrcweir }
302cdf0e10cSrcweir
303cdf0e10cSrcweir SvTreeListBox::MouseMove(rMEvt);
304cdf0e10cSrcweir }
305cdf0e10cSrcweir // -----------------------------------------------------------------------------
MouseButtonUp(const MouseEvent & rMEvt)306cdf0e10cSrcweir void OCreationList::MouseButtonUp( const MouseEvent& rMEvt )
307cdf0e10cSrcweir {
308cdf0e10cSrcweir SvLBoxEntry* pEntry = GetEntry( rMEvt.GetPosPixel() );
309cdf0e10cSrcweir bool bExecute = false;
310cdf0e10cSrcweir // Was the mouse released over the active entry?
311cdf0e10cSrcweir // (i.e. the entry which was under the mouse when the button went down)
312cdf0e10cSrcweir if ( pEntry && ( m_pMouseDownEntry == pEntry ) )
313cdf0e10cSrcweir {
314cdf0e10cSrcweir if ( !rMEvt.IsShift() && !rMEvt.IsMod1() && !rMEvt.IsMod2() && rMEvt.IsLeft() && rMEvt.GetClicks() == 1 )
315cdf0e10cSrcweir bExecute = true;
316cdf0e10cSrcweir }
317cdf0e10cSrcweir
318cdf0e10cSrcweir if ( m_pMouseDownEntry )
319cdf0e10cSrcweir {
320cdf0e10cSrcweir DBG_ASSERT( IsMouseCaptured(), "OCreationList::MouseButtonUp: hmmm .... no mouse captured, but an active entry?" );
321cdf0e10cSrcweir ReleaseMouse();
322cdf0e10cSrcweir
323cdf0e10cSrcweir InvalidateEntry( m_pMouseDownEntry );
324cdf0e10cSrcweir m_pMouseDownEntry = NULL;
325cdf0e10cSrcweir }
326cdf0e10cSrcweir
327cdf0e10cSrcweir SvTreeListBox::MouseButtonUp( rMEvt );
328cdf0e10cSrcweir
329cdf0e10cSrcweir if ( bExecute )
330cdf0e10cSrcweir onSelected( pEntry );
331cdf0e10cSrcweir }
332cdf0e10cSrcweir // -----------------------------------------------------------------------------
setCurrentEntryInvalidate(SvLBoxEntry * _pEntry)333cdf0e10cSrcweir bool OCreationList::setCurrentEntryInvalidate( SvLBoxEntry* _pEntry )
334cdf0e10cSrcweir {
335cdf0e10cSrcweir if ( GetCurEntry() != _pEntry )
336cdf0e10cSrcweir {
337cdf0e10cSrcweir if ( GetCurEntry() )
338cdf0e10cSrcweir InvalidateEntry( GetCurEntry() );
339cdf0e10cSrcweir SetCurEntry( _pEntry );
340cdf0e10cSrcweir if ( GetCurEntry() )
341cdf0e10cSrcweir {
342cdf0e10cSrcweir InvalidateEntry( GetCurEntry() );
343cdf0e10cSrcweir CallEventListeners( VCLEVENT_LISTBOX_SELECT, GetCurEntry() );
344cdf0e10cSrcweir }
345cdf0e10cSrcweir updateHelpText();
346cdf0e10cSrcweir return true;
347cdf0e10cSrcweir }
348cdf0e10cSrcweir return false;
349cdf0e10cSrcweir }
350cdf0e10cSrcweir // -----------------------------------------------------------------------------
updateHelpText()351cdf0e10cSrcweir void OCreationList::updateHelpText()
352cdf0e10cSrcweir {
353cdf0e10cSrcweir sal_uInt16 nHelpTextId = 0;
354cdf0e10cSrcweir if ( GetCurEntry() )
355cdf0e10cSrcweir nHelpTextId = reinterpret_cast< TaskEntry* >( GetCurEntry()->GetUserData() )->nHelpID;
356cdf0e10cSrcweir m_rTaskWindow.setHelpText( nHelpTextId );
357cdf0e10cSrcweir }
358cdf0e10cSrcweir // -----------------------------------------------------------------------------
onSelected(SvLBoxEntry * _pEntry) const359cdf0e10cSrcweir void OCreationList::onSelected( SvLBoxEntry* _pEntry ) const
360cdf0e10cSrcweir {
361cdf0e10cSrcweir DBG_ASSERT( _pEntry, "OCreationList::onSelected: invalid entry!" );
362cdf0e10cSrcweir URL aCommand;
363cdf0e10cSrcweir aCommand.Complete = reinterpret_cast< TaskEntry* >( _pEntry->GetUserData() )->sUNOCommand;
364cdf0e10cSrcweir m_rTaskWindow.getDetailView()->getBorderWin().getView()->getAppController().executeChecked( aCommand, Sequence< PropertyValue >() );
365cdf0e10cSrcweir }
366cdf0e10cSrcweir // -----------------------------------------------------------------------------
KeyInput(const KeyEvent & rKEvt)367cdf0e10cSrcweir void OCreationList::KeyInput( const KeyEvent& rKEvt )
368cdf0e10cSrcweir {
369cdf0e10cSrcweir const KeyCode& rCode = rKEvt.GetKeyCode();
370cdf0e10cSrcweir if ( !rCode.IsMod1() && !rCode.IsMod2() && !rCode.IsShift() )
371cdf0e10cSrcweir {
372cdf0e10cSrcweir if ( rCode.GetCode() == KEY_RETURN )
373cdf0e10cSrcweir {
374cdf0e10cSrcweir SvLBoxEntry* pEntry = GetCurEntry() ? GetCurEntry() : FirstSelected();
375cdf0e10cSrcweir if ( pEntry )
376cdf0e10cSrcweir onSelected( pEntry );
377cdf0e10cSrcweir return;
378cdf0e10cSrcweir }
379cdf0e10cSrcweir }
380cdf0e10cSrcweir SvLBoxEntry* pOldCurrent = GetCurEntry();
381cdf0e10cSrcweir SvTreeListBox::KeyInput(rKEvt);
382cdf0e10cSrcweir SvLBoxEntry* pNewCurrent = GetCurEntry();
383cdf0e10cSrcweir
384cdf0e10cSrcweir if ( pOldCurrent != pNewCurrent )
385cdf0e10cSrcweir {
386cdf0e10cSrcweir if ( pOldCurrent )
387cdf0e10cSrcweir InvalidateEntry( pOldCurrent );
388cdf0e10cSrcweir if ( pNewCurrent )
389cdf0e10cSrcweir {
390cdf0e10cSrcweir InvalidateEntry( pNewCurrent );
391cdf0e10cSrcweir CallEventListeners( VCLEVENT_LISTBOX_SELECT, pNewCurrent );
392cdf0e10cSrcweir } // if ( pNewCurrent )
393cdf0e10cSrcweir updateHelpText();
394cdf0e10cSrcweir }
395cdf0e10cSrcweir }
396cdf0e10cSrcweir // -----------------------------------------------------------------------------
DBG_NAME(OTasksWindow)397cdf0e10cSrcweir DBG_NAME(OTasksWindow)
398cdf0e10cSrcweir OTasksWindow::OTasksWindow(Window* _pParent,OApplicationDetailView* _pDetailView)
399cdf0e10cSrcweir : Window(_pParent,WB_DIALOGCONTROL )
400cdf0e10cSrcweir ,m_aCreation(*this)
401cdf0e10cSrcweir ,m_aDescription(this)
402cdf0e10cSrcweir ,m_aHelpText(this,WB_WORDBREAK)
403cdf0e10cSrcweir ,m_aFL(this,WB_VERT)
404cdf0e10cSrcweir ,m_pDetailView(_pDetailView)
405cdf0e10cSrcweir {
406cdf0e10cSrcweir DBG_CTOR(OTasksWindow,NULL);
407cdf0e10cSrcweir SetUniqueId(UID_APP_TASKS_WINDOW);
408cdf0e10cSrcweir m_aCreation.SetHelpId(HID_APP_CREATION_LIST);
409cdf0e10cSrcweir m_aCreation.SetSelectHdl(LINK(this, OTasksWindow, OnEntrySelectHdl));
410cdf0e10cSrcweir m_aHelpText.SetHelpId(HID_APP_HELP_TEXT);
411cdf0e10cSrcweir m_aDescription.SetHelpId(HID_APP_DESCRIPTION_TEXT);
412cdf0e10cSrcweir m_aDescription.SetText(ModuleRes(STR_DESCRIPTION));
413cdf0e10cSrcweir
414cdf0e10cSrcweir ImageProvider aImageProvider;
415cdf0e10cSrcweir Image aFolderImage = aImageProvider.getFolderImage( DatabaseObject::FORM, false );
416cdf0e10cSrcweir m_aCreation.SetDefaultCollapsedEntryBmp( aFolderImage );
417cdf0e10cSrcweir m_aCreation.SetDefaultExpandedEntryBmp( aFolderImage );
418cdf0e10cSrcweir
419cdf0e10cSrcweir ImplInitSettings(sal_True,sal_True,sal_True);
420cdf0e10cSrcweir }
421cdf0e10cSrcweir // -----------------------------------------------------------------------------
~OTasksWindow()422cdf0e10cSrcweir OTasksWindow::~OTasksWindow()
423cdf0e10cSrcweir {
424cdf0e10cSrcweir DBG_DTOR(OTasksWindow,NULL);
425cdf0e10cSrcweir Clear();
426cdf0e10cSrcweir }
427cdf0e10cSrcweir // -----------------------------------------------------------------------
DataChanged(const DataChangedEvent & rDCEvt)428cdf0e10cSrcweir void OTasksWindow::DataChanged( const DataChangedEvent& rDCEvt )
429cdf0e10cSrcweir {
430cdf0e10cSrcweir DBG_CHKTHIS(OTasksWindow,NULL);
431cdf0e10cSrcweir Window::DataChanged( rDCEvt );
432cdf0e10cSrcweir
433cdf0e10cSrcweir if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
434cdf0e10cSrcweir (rDCEvt.GetFlags() & SETTINGS_STYLE) )
435cdf0e10cSrcweir {
436cdf0e10cSrcweir ImplInitSettings( sal_True, sal_True, sal_True );
437cdf0e10cSrcweir Invalidate();
438cdf0e10cSrcweir }
439cdf0e10cSrcweir }
440cdf0e10cSrcweir // -----------------------------------------------------------------------------
ImplInitSettings(sal_Bool bFont,sal_Bool bForeground,sal_Bool bBackground)441cdf0e10cSrcweir void OTasksWindow::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground )
442cdf0e10cSrcweir {
443cdf0e10cSrcweir DBG_CHKTHIS(OTasksWindow,NULL);
444cdf0e10cSrcweir const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
445cdf0e10cSrcweir if( bFont )
446cdf0e10cSrcweir {
447cdf0e10cSrcweir Font aFont;
448cdf0e10cSrcweir aFont = rStyleSettings.GetFieldFont();
449cdf0e10cSrcweir aFont.SetColor( rStyleSettings.GetWindowTextColor() );
450cdf0e10cSrcweir SetPointFont( aFont );
451cdf0e10cSrcweir }
452cdf0e10cSrcweir
453cdf0e10cSrcweir if( bForeground || bFont )
454cdf0e10cSrcweir {
455cdf0e10cSrcweir SetTextColor( rStyleSettings.GetFieldTextColor() );
456cdf0e10cSrcweir SetTextFillColor();
457cdf0e10cSrcweir m_aHelpText.SetTextColor( rStyleSettings.GetFieldTextColor() );
458cdf0e10cSrcweir m_aHelpText.SetTextFillColor();
459cdf0e10cSrcweir m_aDescription.SetTextColor( rStyleSettings.GetFieldTextColor() );
460cdf0e10cSrcweir m_aDescription.SetTextFillColor();
461cdf0e10cSrcweir //m_aFL.SetTextColor( rStyleSettings.GetFieldTextColor() );
462cdf0e10cSrcweir //m_aFL.SetTextFillColor();
463cdf0e10cSrcweir }
464cdf0e10cSrcweir
465cdf0e10cSrcweir if( bBackground )
466cdf0e10cSrcweir {
467cdf0e10cSrcweir SetBackground( rStyleSettings.GetFieldColor() );
468cdf0e10cSrcweir m_aHelpText.SetBackground( rStyleSettings.GetFieldColor() );
469cdf0e10cSrcweir m_aDescription.SetBackground( rStyleSettings.GetFieldColor() );
470cdf0e10cSrcweir m_aFL.SetBackground( rStyleSettings.GetFieldColor() );
471cdf0e10cSrcweir }
472cdf0e10cSrcweir
473cdf0e10cSrcweir Font aFont = m_aDescription.GetControlFont();
474cdf0e10cSrcweir aFont.SetWeight(WEIGHT_BOLD);
475cdf0e10cSrcweir m_aDescription.SetControlFont(aFont);
476cdf0e10cSrcweir }
477cdf0e10cSrcweir // -----------------------------------------------------------------------------
setHelpText(sal_uInt16 _nId)478cdf0e10cSrcweir void OTasksWindow::setHelpText(sal_uInt16 _nId)
479cdf0e10cSrcweir {
480cdf0e10cSrcweir DBG_CHKTHIS(OTasksWindow,NULL);
481cdf0e10cSrcweir if ( _nId )
482cdf0e10cSrcweir {
483cdf0e10cSrcweir String sText = ModuleRes(_nId);
484cdf0e10cSrcweir
485cdf0e10cSrcweir // calulate the size of the text field
486cdf0e10cSrcweir // Size aHelpTextSize = m_aHelpText.GetSizePixel();
487cdf0e10cSrcweir // Size aHelpTextPixelSize = LogicToPixel( aHelpTextSize, MAP_APPFONT );
488cdf0e10cSrcweir // Rectangle aPrimaryRect( Point(0,0), aHelpTextSize );
489cdf0e10cSrcweir // Rectangle aSuggestedRect( GetTextRect( aPrimaryRect, sText, TEXT_DRAW_MULTILINE | TEXT_DRAW_LEFT | TEXT_DRAW_WORDBREAK ) );
490cdf0e10cSrcweir m_aHelpText.SetText(sText);
491cdf0e10cSrcweir }
492cdf0e10cSrcweir else
493cdf0e10cSrcweir {
494cdf0e10cSrcweir m_aHelpText.SetText(String());
495cdf0e10cSrcweir }
496cdf0e10cSrcweir }
497cdf0e10cSrcweir // -----------------------------------------------------------------------------
498cdf0e10cSrcweir IMPL_LINK(OTasksWindow, OnEntrySelectHdl, SvTreeListBox*, /*_pTreeBox*/)
499cdf0e10cSrcweir {
500cdf0e10cSrcweir DBG_CHKTHIS(OTasksWindow,NULL);
501cdf0e10cSrcweir SvLBoxEntry* pEntry = m_aCreation.GetHdlEntry();
502cdf0e10cSrcweir if ( pEntry )
503cdf0e10cSrcweir m_aHelpText.SetText( ModuleRes( reinterpret_cast< TaskEntry* >( pEntry->GetUserData() )->nHelpID ) );
504cdf0e10cSrcweir return 1L;
505cdf0e10cSrcweir }
506cdf0e10cSrcweir // -----------------------------------------------------------------------------
Resize()507cdf0e10cSrcweir void OTasksWindow::Resize()
508cdf0e10cSrcweir {
509cdf0e10cSrcweir DBG_CHKTHIS(OTasksWindow,NULL);
510cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////
511cdf0e10cSrcweir // Abmessungen parent window
512cdf0e10cSrcweir Size aOutputSize( GetOutputSize() );
513cdf0e10cSrcweir long nOutputWidth = aOutputSize.Width();
514cdf0e10cSrcweir long nOutputHeight = aOutputSize.Height();
515cdf0e10cSrcweir
516cdf0e10cSrcweir Size aFLSize = LogicToPixel( Size( 2, 6 ), MAP_APPFONT );
517cdf0e10cSrcweir sal_Int32 n6PPT = aFLSize.Height();
518cdf0e10cSrcweir long nHalfOutputWidth = static_cast<long>(nOutputWidth * 0.5);
519cdf0e10cSrcweir
520cdf0e10cSrcweir m_aCreation.SetPosSizePixel( Point(0, 0), Size(nHalfOutputWidth - n6PPT, nOutputHeight) );
521cdf0e10cSrcweir // i77897 make the m_aHelpText a little bit smaller. (-5)
522cdf0e10cSrcweir sal_Int32 nNewWidth = nOutputWidth - nHalfOutputWidth - aFLSize.Width() - 5;
523cdf0e10cSrcweir // m_aHelpText.SetBackground( MAKE_SALCOLOR( 0xe0, 0xe0, 0xe0 ) );
524cdf0e10cSrcweir // Wallpaper aLightGray(Color(0xe0, 0xe0, 0xe0));
525cdf0e10cSrcweir // m_aHelpText.SetBackground( aLightGray );
526cdf0e10cSrcweir m_aDescription.SetPosSizePixel( Point(nHalfOutputWidth + n6PPT, 0), Size(nNewWidth, nOutputHeight) );
527cdf0e10cSrcweir Size aDesc = m_aDescription.CalcMinimumSize();
528cdf0e10cSrcweir m_aHelpText.SetPosSizePixel( Point(nHalfOutputWidth + n6PPT, aDesc.Height() ), Size(nNewWidth, nOutputHeight - aDesc.Height() - n6PPT) );
529cdf0e10cSrcweir
530cdf0e10cSrcweir m_aFL.SetPosSizePixel( Point(nHalfOutputWidth , 0), Size(aFLSize.Width(), nOutputHeight ) );
531cdf0e10cSrcweir }
532cdf0e10cSrcweir // -----------------------------------------------------------------------------
fillTaskEntryList(const TaskEntryList & _rList)533cdf0e10cSrcweir void OTasksWindow::fillTaskEntryList( const TaskEntryList& _rList )
534cdf0e10cSrcweir {
535cdf0e10cSrcweir DBG_CHKTHIS(OTasksWindow,NULL);
536cdf0e10cSrcweir Clear();
537cdf0e10cSrcweir
538cdf0e10cSrcweir try
539cdf0e10cSrcweir {
540cdf0e10cSrcweir Reference<XModuleUIConfigurationManagerSupplier> xModuleCfgMgrSupplier(getDetailView()->getBorderWin().getView()->getORB()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.ModuleUIConfigurationManagerSupplier"))),UNO_QUERY);
541cdf0e10cSrcweir Reference<XUIConfigurationManager> xUIConfigMgr = xModuleCfgMgrSupplier->getUIConfigurationManager(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.OfficeDatabaseDocument")));
542cdf0e10cSrcweir Reference<XImageManager> xImageMgr(xUIConfigMgr->getImageManager(),UNO_QUERY);
543cdf0e10cSrcweir
544cdf0e10cSrcweir // copy the commands so we can use them with the config managers
545cdf0e10cSrcweir Sequence< ::rtl::OUString > aCommands( _rList.size() );
546cdf0e10cSrcweir ::rtl::OUString* pCommands = aCommands.getArray();
547cdf0e10cSrcweir TaskEntryList::const_iterator aEnd = _rList.end();
548cdf0e10cSrcweir for ( TaskEntryList::const_iterator pCopyTask = _rList.begin(); pCopyTask != aEnd; ++pCopyTask, ++pCommands )
549cdf0e10cSrcweir *pCommands = pCopyTask->sUNOCommand;
550cdf0e10cSrcweir
551cdf0e10cSrcweir Sequence< Reference< XGraphic> > aImages = xImageMgr->getImages( ImageType::SIZE_DEFAULT | ImageType::COLOR_NORMAL, aCommands );
552cdf0e10cSrcweir Sequence< Reference< XGraphic> > aHCImages = xImageMgr->getImages( ImageType::SIZE_DEFAULT | ImageType::COLOR_HIGHCONTRAST, aCommands );
553cdf0e10cSrcweir
554cdf0e10cSrcweir const Reference< XGraphic >* pImages( aImages.getConstArray() );
555cdf0e10cSrcweir const Reference< XGraphic >* pHCImages( aHCImages.getConstArray() );
556cdf0e10cSrcweir
557cdf0e10cSrcweir for ( TaskEntryList::const_iterator pTask = _rList.begin(); pTask != aEnd; ++pTask, ++pImages, ++pHCImages )
558cdf0e10cSrcweir {
559cdf0e10cSrcweir SvLBoxEntry* pEntry = m_aCreation.InsertEntry( pTask->sTitle );
560cdf0e10cSrcweir pEntry->SetUserData( reinterpret_cast< void* >( new TaskEntry( *pTask ) ) );
561cdf0e10cSrcweir
562cdf0e10cSrcweir Image aImage = Image( *pImages );
563cdf0e10cSrcweir m_aCreation.SetExpandedEntryBmp( pEntry, aImage, BMP_COLOR_NORMAL );
564cdf0e10cSrcweir m_aCreation.SetCollapsedEntryBmp( pEntry, aImage, BMP_COLOR_NORMAL );
565cdf0e10cSrcweir
566cdf0e10cSrcweir Image aHCImage = Image( *pHCImages );
567cdf0e10cSrcweir m_aCreation.SetExpandedEntryBmp( pEntry, aHCImage, BMP_COLOR_HIGHCONTRAST );
568cdf0e10cSrcweir m_aCreation.SetCollapsedEntryBmp( pEntry, aHCImage, BMP_COLOR_HIGHCONTRAST );
569cdf0e10cSrcweir }
570cdf0e10cSrcweir }
571cdf0e10cSrcweir catch(Exception&)
572cdf0e10cSrcweir {
573cdf0e10cSrcweir }
574cdf0e10cSrcweir
575cdf0e10cSrcweir m_aCreation.Show();
576cdf0e10cSrcweir m_aCreation.SelectAll(sal_False);
577cdf0e10cSrcweir m_aHelpText.Show();
578cdf0e10cSrcweir m_aDescription.Show();
579cdf0e10cSrcweir m_aFL.Show();
580cdf0e10cSrcweir m_aCreation.updateHelpText();
581cdf0e10cSrcweir Enable(!_rList.empty());
582cdf0e10cSrcweir }
583cdf0e10cSrcweir // -----------------------------------------------------------------------------
Clear()584cdf0e10cSrcweir void OTasksWindow::Clear()
585cdf0e10cSrcweir {
586cdf0e10cSrcweir DBG_CHKTHIS(OTasksWindow,NULL);
587cdf0e10cSrcweir m_aCreation.resetLastActive();
588cdf0e10cSrcweir SvLBoxEntry* pEntry = m_aCreation.First();
589cdf0e10cSrcweir while ( pEntry )
590cdf0e10cSrcweir {
591cdf0e10cSrcweir delete reinterpret_cast< TaskEntry* >( pEntry->GetUserData() );
592cdf0e10cSrcweir pEntry = m_aCreation.Next(pEntry);
593cdf0e10cSrcweir }
594cdf0e10cSrcweir m_aCreation.Clear();
595cdf0e10cSrcweir }
596cdf0e10cSrcweir //==================================================================
597cdf0e10cSrcweir // class OApplicationDetailView
598cdf0e10cSrcweir //==================================================================
DBG_NAME(OApplicationDetailView)599cdf0e10cSrcweir DBG_NAME(OApplicationDetailView)
600cdf0e10cSrcweir OApplicationDetailView::OApplicationDetailView(OAppBorderWindow& _rParent,PreviewMode _ePreviewMode) : OSplitterView(&_rParent,sal_False )
601cdf0e10cSrcweir ,m_aHorzSplitter(this)
602cdf0e10cSrcweir ,m_aTasks(this,STR_TASKS,WB_BORDER | WB_DIALOGCONTROL )
603cdf0e10cSrcweir ,m_aContainer(this,0,WB_BORDER | WB_DIALOGCONTROL )
604cdf0e10cSrcweir ,m_rBorderWin(_rParent)
605cdf0e10cSrcweir {
606cdf0e10cSrcweir DBG_CTOR(OApplicationDetailView,NULL);
607cdf0e10cSrcweir SetUniqueId(UID_APP_DETAIL_VIEW);
608cdf0e10cSrcweir ImplInitSettings( sal_True, sal_True, sal_True );
609cdf0e10cSrcweir
610cdf0e10cSrcweir m_pControlHelper = new OAppDetailPageHelper(&m_aContainer,m_rBorderWin,_ePreviewMode);
611cdf0e10cSrcweir m_pControlHelper->Show();
612cdf0e10cSrcweir m_aContainer.setChildWindow(m_pControlHelper);
613cdf0e10cSrcweir
614cdf0e10cSrcweir OTasksWindow* pTasks = new OTasksWindow(&m_aTasks,this);
615cdf0e10cSrcweir pTasks->Show();
616cdf0e10cSrcweir pTasks->Disable(m_rBorderWin.getView()->getCommandController().isDataSourceReadOnly());
617cdf0e10cSrcweir m_aTasks.setChildWindow(pTasks);
618cdf0e10cSrcweir m_aTasks.SetUniqueId(UID_APP_TASKS_VIEW);
619cdf0e10cSrcweir m_aTasks.Show();
620cdf0e10cSrcweir
621cdf0e10cSrcweir m_aContainer.SetUniqueId(UID_APP_CONTAINER_VIEW);
622cdf0e10cSrcweir m_aContainer.Show();
623cdf0e10cSrcweir
624cdf0e10cSrcweir const long nFrameWidth = LogicToPixel( Size( 3, 0 ), MAP_APPFONT ).Width();
625cdf0e10cSrcweir m_aHorzSplitter.SetPosSizePixel( Point(0,50), Size(0,nFrameWidth) );
626cdf0e10cSrcweir // now set the components at the base class
627cdf0e10cSrcweir set(&m_aContainer,&m_aTasks);
628cdf0e10cSrcweir
629cdf0e10cSrcweir m_aHorzSplitter.Show();
630cdf0e10cSrcweir m_aHorzSplitter.SetUniqueId(UID_APP_VIEW_HORZ_SPLIT);
631cdf0e10cSrcweir setSplitter(&m_aHorzSplitter);
632cdf0e10cSrcweir }
633cdf0e10cSrcweir // -----------------------------------------------------------------------------
~OApplicationDetailView()634cdf0e10cSrcweir OApplicationDetailView::~OApplicationDetailView()
635cdf0e10cSrcweir {
636cdf0e10cSrcweir DBG_DTOR(OApplicationDetailView,NULL);
637cdf0e10cSrcweir set(NULL,NULL);
638cdf0e10cSrcweir setSplitter(NULL);
639cdf0e10cSrcweir m_pControlHelper = NULL;
640cdf0e10cSrcweir }
641cdf0e10cSrcweir // -----------------------------------------------------------------------------
ImplInitSettings(sal_Bool bFont,sal_Bool bForeground,sal_Bool bBackground)642cdf0e10cSrcweir void OApplicationDetailView::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground )
643cdf0e10cSrcweir {
644cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
645cdf0e10cSrcweir const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
646cdf0e10cSrcweir if( bFont )
647cdf0e10cSrcweir {
648cdf0e10cSrcweir Font aFont;
649cdf0e10cSrcweir aFont = rStyleSettings.GetFieldFont();
650cdf0e10cSrcweir aFont.SetColor( rStyleSettings.GetWindowTextColor() );
651cdf0e10cSrcweir SetPointFont( aFont );
652cdf0e10cSrcweir }
653cdf0e10cSrcweir
654cdf0e10cSrcweir if( bForeground || bFont )
655cdf0e10cSrcweir {
656cdf0e10cSrcweir SetTextColor( rStyleSettings.GetFieldTextColor() );
657cdf0e10cSrcweir SetTextFillColor();
658cdf0e10cSrcweir }
659cdf0e10cSrcweir
660cdf0e10cSrcweir if( bBackground )
661cdf0e10cSrcweir SetBackground( rStyleSettings.GetFieldColor() );
662cdf0e10cSrcweir
663cdf0e10cSrcweir //SetBackground( Wallpaper( GetSettings().GetStyleSettings().GetDialogColor() ) );
664cdf0e10cSrcweir m_aHorzSplitter.SetBackground( rStyleSettings.GetDialogColor() );
665cdf0e10cSrcweir m_aHorzSplitter.SetFillColor( rStyleSettings.GetDialogColor() );
666cdf0e10cSrcweir m_aHorzSplitter.SetTextFillColor(rStyleSettings.GetDialogColor() );
667cdf0e10cSrcweir }
668cdf0e10cSrcweir // -----------------------------------------------------------------------
DataChanged(const DataChangedEvent & rDCEvt)669cdf0e10cSrcweir void OApplicationDetailView::DataChanged( const DataChangedEvent& rDCEvt )
670cdf0e10cSrcweir {
671cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
672cdf0e10cSrcweir OSplitterView::DataChanged( rDCEvt );
673cdf0e10cSrcweir
674cdf0e10cSrcweir if ( (rDCEvt.GetType() == DATACHANGED_FONTS) ||
675cdf0e10cSrcweir (rDCEvt.GetType() == DATACHANGED_DISPLAY) ||
676cdf0e10cSrcweir (rDCEvt.GetType() == DATACHANGED_FONTSUBSTITUTION) ||
677cdf0e10cSrcweir ((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
678cdf0e10cSrcweir (rDCEvt.GetFlags() & SETTINGS_STYLE)) )
679cdf0e10cSrcweir {
680cdf0e10cSrcweir ImplInitSettings( sal_True, sal_True, sal_True );
681cdf0e10cSrcweir Invalidate();
682cdf0e10cSrcweir }
683cdf0e10cSrcweir }
684cdf0e10cSrcweir // -----------------------------------------------------------------------------
GetFocus()685cdf0e10cSrcweir void OApplicationDetailView::GetFocus()
686cdf0e10cSrcweir {
687cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
688cdf0e10cSrcweir OSplitterView::GetFocus();
689cdf0e10cSrcweir }
690cdf0e10cSrcweir
691cdf0e10cSrcweir // -----------------------------------------------------------------------------
setTaskExternalMnemonics(MnemonicGenerator & _rMnemonics)692cdf0e10cSrcweir void OApplicationDetailView::setTaskExternalMnemonics( MnemonicGenerator& _rMnemonics )
693cdf0e10cSrcweir {
694cdf0e10cSrcweir m_aExternalMnemonics = _rMnemonics;
695cdf0e10cSrcweir }
696cdf0e10cSrcweir
697cdf0e10cSrcweir // -----------------------------------------------------------------------------
interceptKeyInput(const KeyEvent & _rEvent)698cdf0e10cSrcweir bool OApplicationDetailView::interceptKeyInput( const KeyEvent& _rEvent )
699cdf0e10cSrcweir {
700cdf0e10cSrcweir const KeyCode& rKeyCode = _rEvent.GetKeyCode();
701cdf0e10cSrcweir if ( rKeyCode.GetModifier() == KEY_MOD2 )
702cdf0e10cSrcweir return getTasksWindow().HandleKeyInput( _rEvent );
703cdf0e10cSrcweir
704cdf0e10cSrcweir // not handled
705cdf0e10cSrcweir return false;
706cdf0e10cSrcweir }
707cdf0e10cSrcweir
708cdf0e10cSrcweir // -----------------------------------------------------------------------------
createTablesPage(const Reference<XConnection> & _xConnection)709cdf0e10cSrcweir void OApplicationDetailView::createTablesPage(const Reference< XConnection >& _xConnection )
710cdf0e10cSrcweir {
711cdf0e10cSrcweir impl_createPage( E_TABLE, _xConnection, NULL );
712cdf0e10cSrcweir }
713cdf0e10cSrcweir
714cdf0e10cSrcweir // -----------------------------------------------------------------------------
createPage(ElementType _eType,const Reference<XNameAccess> & _xContainer)715cdf0e10cSrcweir void OApplicationDetailView::createPage( ElementType _eType,const Reference< XNameAccess >& _xContainer )
716cdf0e10cSrcweir {
717cdf0e10cSrcweir impl_createPage( _eType, NULL, _xContainer );
718cdf0e10cSrcweir }
719cdf0e10cSrcweir
720cdf0e10cSrcweir // -----------------------------------------------------------------------------
impl_createPage(ElementType _eType,const Reference<XConnection> & _rxConnection,const Reference<XNameAccess> & _rxNonTableElements)721cdf0e10cSrcweir void OApplicationDetailView::impl_createPage( ElementType _eType, const Reference< XConnection >& _rxConnection,
722cdf0e10cSrcweir const Reference< XNameAccess >& _rxNonTableElements )
723cdf0e10cSrcweir {
724cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
725cdf0e10cSrcweir
726cdf0e10cSrcweir // get the data for the pane
727cdf0e10cSrcweir const TaskPaneData& rData = impl_getTaskPaneData( _eType );
728cdf0e10cSrcweir getTasksWindow().fillTaskEntryList( rData.aTasks );
729cdf0e10cSrcweir
730cdf0e10cSrcweir // enable the pane as a whole, depending on the availability of the first command
731cdf0e10cSrcweir OSL_ENSURE( !rData.aTasks.empty(), "OApplicationDetailView::impl_createPage: no tasks at all!?" );
732cdf0e10cSrcweir bool bEnabled = rData.aTasks.empty()
733cdf0e10cSrcweir ? false
734cdf0e10cSrcweir : getBorderWin().getView()->getCommandController().isCommandEnabled( rData.aTasks[0].sUNOCommand );
735cdf0e10cSrcweir getTasksWindow().Enable( bEnabled );
736cdf0e10cSrcweir m_aContainer.setTitle( rData.nTitleId );
737cdf0e10cSrcweir
738cdf0e10cSrcweir // let our helper create the object list
739cdf0e10cSrcweir if ( _eType == E_TABLE )
740cdf0e10cSrcweir m_pControlHelper->createTablesPage( _rxConnection );
741cdf0e10cSrcweir else
742cdf0e10cSrcweir m_pControlHelper->createPage( _eType, _rxNonTableElements );
743cdf0e10cSrcweir
744cdf0e10cSrcweir // resize for proper window arrangements
745cdf0e10cSrcweir Resize();
746cdf0e10cSrcweir }
747cdf0e10cSrcweir
748cdf0e10cSrcweir // -----------------------------------------------------------------------------
impl_getTaskPaneData(ElementType _eType)749cdf0e10cSrcweir const TaskPaneData& OApplicationDetailView::impl_getTaskPaneData( ElementType _eType )
750cdf0e10cSrcweir {
751cdf0e10cSrcweir if ( m_aTaskPaneData.empty() )
752cdf0e10cSrcweir m_aTaskPaneData.resize( ELEMENT_COUNT );
753cdf0e10cSrcweir OSL_ENSURE( ( _eType >= 0 ) && ( _eType < E_ELEMENT_TYPE_COUNT ), "OApplicationDetailView::impl_getTaskPaneData: illegal element type!" );
754cdf0e10cSrcweir TaskPaneData& rData = m_aTaskPaneData[ _eType ];
755cdf0e10cSrcweir
756cdf0e10cSrcweir // if ( rData.aTasks.empty() )
757cdf0e10cSrcweir //oj: do not check, otherwise extensions will only be visible after a reload.
758cdf0e10cSrcweir impl_fillTaskPaneData( _eType, rData );
759cdf0e10cSrcweir
760cdf0e10cSrcweir return rData;
761cdf0e10cSrcweir }
762cdf0e10cSrcweir
763cdf0e10cSrcweir // -----------------------------------------------------------------------------
impl_fillTaskPaneData(ElementType _eType,TaskPaneData & _rData) const764cdf0e10cSrcweir void OApplicationDetailView::impl_fillTaskPaneData( ElementType _eType, TaskPaneData& _rData ) const
765cdf0e10cSrcweir {
766cdf0e10cSrcweir TaskEntryList& rList( _rData.aTasks );
767cdf0e10cSrcweir rList.clear(); rList.reserve( 4 );
768cdf0e10cSrcweir
769cdf0e10cSrcweir switch ( _eType )
770cdf0e10cSrcweir {
771cdf0e10cSrcweir case E_TABLE:
772cdf0e10cSrcweir rList.push_back( TaskEntry( ".uno:DBNewTable", RID_STR_TABLES_HELP_TEXT_DESIGN, RID_STR_NEW_TABLE ) );
773cdf0e10cSrcweir rList.push_back( TaskEntry( ".uno:DBNewTableAutoPilot", RID_STR_TABLES_HELP_TEXT_WIZARD, RID_STR_NEW_TABLE_AUTO ) );
774cdf0e10cSrcweir rList.push_back( TaskEntry( ".uno:DBNewView", RID_STR_VIEWS_HELP_TEXT_DESIGN, RID_STR_NEW_VIEW, true ) );
775cdf0e10cSrcweir _rData.nTitleId = RID_STR_TABLES_CONTAINER;
776cdf0e10cSrcweir break;
777cdf0e10cSrcweir
778cdf0e10cSrcweir case E_FORM:
779cdf0e10cSrcweir rList.push_back( TaskEntry( ".uno:DBNewForm", RID_STR_FORMS_HELP_TEXT, RID_STR_NEW_FORM ) );
780cdf0e10cSrcweir rList.push_back( TaskEntry( ".uno:DBNewFormAutoPilot", RID_STR_FORMS_HELP_TEXT_WIZARD, RID_STR_NEW_FORM_AUTO ) );
781cdf0e10cSrcweir _rData.nTitleId = RID_STR_FORMS_CONTAINER;
782cdf0e10cSrcweir break;
783cdf0e10cSrcweir
784cdf0e10cSrcweir case E_REPORT:
785cdf0e10cSrcweir rList.push_back( TaskEntry( ".uno:DBNewReport", RID_STR_REPORT_HELP_TEXT, RID_STR_NEW_REPORT, true ) );
786cdf0e10cSrcweir rList.push_back( TaskEntry( ".uno:DBNewReportAutoPilot", RID_STR_REPORTS_HELP_TEXT_WIZARD, RID_STR_NEW_REPORT_AUTO ) );
787cdf0e10cSrcweir _rData.nTitleId = RID_STR_REPORTS_CONTAINER;
788cdf0e10cSrcweir break;
789cdf0e10cSrcweir
790cdf0e10cSrcweir case E_QUERY:
791cdf0e10cSrcweir rList.push_back( TaskEntry( ".uno:DBNewQuery", RID_STR_QUERIES_HELP_TEXT, RID_STR_NEW_QUERY ) );
792cdf0e10cSrcweir rList.push_back( TaskEntry( ".uno:DBNewQueryAutoPilot", RID_STR_QUERIES_HELP_TEXT_WIZARD, RID_STR_NEW_QUERY_AUTO ) );
793cdf0e10cSrcweir rList.push_back( TaskEntry( ".uno:DBNewQuerySql", RID_STR_QUERIES_HELP_TEXT_SQL, RID_STR_NEW_QUERY_SQL ) );
794cdf0e10cSrcweir _rData.nTitleId = RID_STR_QUERIES_CONTAINER;
795cdf0e10cSrcweir break;
796cdf0e10cSrcweir
797cdf0e10cSrcweir default:
798cdf0e10cSrcweir OSL_ENSURE( false, "OApplicationDetailView::impl_fillTaskPaneData: illegal element type!" );
799cdf0e10cSrcweir }
800cdf0e10cSrcweir
801cdf0e10cSrcweir MnemonicGenerator aAllMnemonics( m_aExternalMnemonics );
802cdf0e10cSrcweir
803cdf0e10cSrcweir // remove the entries which are not enabled currently
804cdf0e10cSrcweir for ( TaskEntryList::iterator pTask = rList.begin();
805cdf0e10cSrcweir pTask != rList.end();
806cdf0e10cSrcweir )
807cdf0e10cSrcweir {
808cdf0e10cSrcweir if ( pTask->bHideWhenDisabled
809cdf0e10cSrcweir && !getBorderWin().getView()->getCommandController().isCommandEnabled( pTask->sUNOCommand )
810cdf0e10cSrcweir )
811cdf0e10cSrcweir pTask = rList.erase( pTask );
812cdf0e10cSrcweir else
813cdf0e10cSrcweir {
814cdf0e10cSrcweir aAllMnemonics.RegisterMnemonic( pTask->sTitle );
815cdf0e10cSrcweir ++pTask;
816cdf0e10cSrcweir }
817cdf0e10cSrcweir }
818cdf0e10cSrcweir
819cdf0e10cSrcweir // for the remaining entries, assign mnemonics
820cdf0e10cSrcweir for ( TaskEntryList::iterator pTask = rList.begin();
821cdf0e10cSrcweir pTask != rList.end();
822cdf0e10cSrcweir ++pTask
823cdf0e10cSrcweir )
824cdf0e10cSrcweir {
825cdf0e10cSrcweir aAllMnemonics.CreateMnemonic( pTask->sTitle );
826cdf0e10cSrcweir // don't do this for now, until our task window really supports mnemonics
827cdf0e10cSrcweir }
828cdf0e10cSrcweir }
829cdf0e10cSrcweir
830cdf0e10cSrcweir // -----------------------------------------------------------------------------
getQualifiedName(SvLBoxEntry * _pEntry) const831cdf0e10cSrcweir ::rtl::OUString OApplicationDetailView::getQualifiedName( SvLBoxEntry* _pEntry ) const
832cdf0e10cSrcweir {
833cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
834cdf0e10cSrcweir return m_pControlHelper->getQualifiedName( _pEntry );
835cdf0e10cSrcweir }
836cdf0e10cSrcweir // -----------------------------------------------------------------------------
isLeaf(SvLBoxEntry * _pEntry) const837cdf0e10cSrcweir sal_Bool OApplicationDetailView::isLeaf(SvLBoxEntry* _pEntry) const
838cdf0e10cSrcweir {
839cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
840cdf0e10cSrcweir return m_pControlHelper->isLeaf(_pEntry);
841cdf0e10cSrcweir }
842cdf0e10cSrcweir // -----------------------------------------------------------------------------
isALeafSelected() const843cdf0e10cSrcweir sal_Bool OApplicationDetailView::isALeafSelected() const
844cdf0e10cSrcweir {
845cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
846cdf0e10cSrcweir return m_pControlHelper->isALeafSelected();
847cdf0e10cSrcweir }
848cdf0e10cSrcweir // -----------------------------------------------------------------------------
selectAll()849cdf0e10cSrcweir void OApplicationDetailView::selectAll()
850cdf0e10cSrcweir {
851cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
852cdf0e10cSrcweir m_pControlHelper->selectAll();
853cdf0e10cSrcweir }
854cdf0e10cSrcweir // -----------------------------------------------------------------------------
sortDown()855cdf0e10cSrcweir void OApplicationDetailView::sortDown()
856cdf0e10cSrcweir {
857cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
858cdf0e10cSrcweir m_pControlHelper->sortDown();
859cdf0e10cSrcweir }
860cdf0e10cSrcweir // -----------------------------------------------------------------------------
sortUp()861cdf0e10cSrcweir void OApplicationDetailView::sortUp()
862cdf0e10cSrcweir {
863cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
864cdf0e10cSrcweir m_pControlHelper->sortUp();
865cdf0e10cSrcweir }
866cdf0e10cSrcweir // -----------------------------------------------------------------------------
isFilled() const867cdf0e10cSrcweir sal_Bool OApplicationDetailView::isFilled() const
868cdf0e10cSrcweir {
869cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
870cdf0e10cSrcweir return m_pControlHelper->isFilled();
871cdf0e10cSrcweir }
872cdf0e10cSrcweir // -----------------------------------------------------------------------------
getElementType() const873cdf0e10cSrcweir ElementType OApplicationDetailView::getElementType() const
874cdf0e10cSrcweir {
875cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
876cdf0e10cSrcweir return m_pControlHelper->getElementType();
877cdf0e10cSrcweir }
878cdf0e10cSrcweir // -----------------------------------------------------------------------------
clearPages(sal_Bool _bTaskAlso)879cdf0e10cSrcweir void OApplicationDetailView::clearPages(sal_Bool _bTaskAlso)
880cdf0e10cSrcweir {
881cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
882cdf0e10cSrcweir if ( _bTaskAlso )
883cdf0e10cSrcweir getTasksWindow().Clear();
884cdf0e10cSrcweir m_pControlHelper->clearPages();
885cdf0e10cSrcweir }
886cdf0e10cSrcweir // -----------------------------------------------------------------------------
getSelectionCount()887cdf0e10cSrcweir sal_Int32 OApplicationDetailView::getSelectionCount()
888cdf0e10cSrcweir {
889cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
890cdf0e10cSrcweir return m_pControlHelper->getSelectionCount();
891cdf0e10cSrcweir }
892cdf0e10cSrcweir // -----------------------------------------------------------------------------
getElementCount()893cdf0e10cSrcweir sal_Int32 OApplicationDetailView::getElementCount()
894cdf0e10cSrcweir {
895cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
896cdf0e10cSrcweir return m_pControlHelper->getElementCount();
897cdf0e10cSrcweir }
898cdf0e10cSrcweir
899cdf0e10cSrcweir // -----------------------------------------------------------------------------
getSelectionElementNames(::std::vector<::rtl::OUString> & _rNames) const900cdf0e10cSrcweir void OApplicationDetailView::getSelectionElementNames( ::std::vector< ::rtl::OUString>& _rNames ) const
901cdf0e10cSrcweir {
902cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
903cdf0e10cSrcweir m_pControlHelper->getSelectionElementNames( _rNames );
904cdf0e10cSrcweir }
905cdf0e10cSrcweir // -----------------------------------------------------------------------------
describeCurrentSelectionForControl(const Control & _rControl,Sequence<NamedDatabaseObject> & _out_rSelectedObjects)906cdf0e10cSrcweir void OApplicationDetailView::describeCurrentSelectionForControl( const Control& _rControl, Sequence< NamedDatabaseObject >& _out_rSelectedObjects )
907cdf0e10cSrcweir {
908cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
909cdf0e10cSrcweir m_pControlHelper->describeCurrentSelectionForControl( _rControl, _out_rSelectedObjects );
910cdf0e10cSrcweir }
911cdf0e10cSrcweir // -----------------------------------------------------------------------------
describeCurrentSelectionForType(const ElementType _eType,Sequence<NamedDatabaseObject> & _out_rSelectedObjects)912cdf0e10cSrcweir void OApplicationDetailView::describeCurrentSelectionForType( const ElementType _eType, Sequence< NamedDatabaseObject >& _out_rSelectedObjects )
913cdf0e10cSrcweir {
914cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
915cdf0e10cSrcweir m_pControlHelper->describeCurrentSelectionForType( _eType, _out_rSelectedObjects );
916cdf0e10cSrcweir }
917cdf0e10cSrcweir // -----------------------------------------------------------------------------
selectElements(const Sequence<::rtl::OUString> & _aNames)918cdf0e10cSrcweir void OApplicationDetailView::selectElements(const Sequence< ::rtl::OUString>& _aNames)
919cdf0e10cSrcweir {
920cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
921cdf0e10cSrcweir m_pControlHelper->selectElements( _aNames );
922cdf0e10cSrcweir }
923cdf0e10cSrcweir // -----------------------------------------------------------------------------
getEntry(const Point & _aPoint) const924cdf0e10cSrcweir SvLBoxEntry* OApplicationDetailView::getEntry( const Point& _aPoint ) const
925cdf0e10cSrcweir {
926cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
927cdf0e10cSrcweir return m_pControlHelper->getEntry(_aPoint);
928cdf0e10cSrcweir }
929cdf0e10cSrcweir // -----------------------------------------------------------------------------
isCutAllowed()930cdf0e10cSrcweir sal_Bool OApplicationDetailView::isCutAllowed()
931cdf0e10cSrcweir {
932cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
933cdf0e10cSrcweir return m_pControlHelper->isCutAllowed();
934cdf0e10cSrcweir }
isCopyAllowed()935cdf0e10cSrcweir sal_Bool OApplicationDetailView::isCopyAllowed()
936cdf0e10cSrcweir {
937cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
938cdf0e10cSrcweir return m_pControlHelper->isCopyAllowed();
939cdf0e10cSrcweir }
isPasteAllowed()940cdf0e10cSrcweir sal_Bool OApplicationDetailView::isPasteAllowed() { DBG_CHKTHIS(OApplicationDetailView,NULL);return m_pControlHelper->isPasteAllowed(); }
copy()941cdf0e10cSrcweir void OApplicationDetailView::copy() { DBG_CHKTHIS(OApplicationDetailView,NULL);m_pControlHelper->copy(); }
cut()942cdf0e10cSrcweir void OApplicationDetailView::cut() { DBG_CHKTHIS(OApplicationDetailView,NULL);m_pControlHelper->cut(); }
paste()943cdf0e10cSrcweir void OApplicationDetailView::paste()
944cdf0e10cSrcweir {
945cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
946cdf0e10cSrcweir m_pControlHelper->paste();
947cdf0e10cSrcweir }
948cdf0e10cSrcweir // -----------------------------------------------------------------------------
elementAdded(ElementType _eType,const::rtl::OUString & _rName,const Any & _rObject)949cdf0e10cSrcweir SvLBoxEntry* OApplicationDetailView::elementAdded(ElementType _eType,const ::rtl::OUString& _rName, const Any& _rObject )
950cdf0e10cSrcweir {
951cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
952cdf0e10cSrcweir return m_pControlHelper->elementAdded(_eType,_rName, _rObject );
953cdf0e10cSrcweir }
954cdf0e10cSrcweir // -----------------------------------------------------------------------------
elementRemoved(ElementType _eType,const::rtl::OUString & _rName)955cdf0e10cSrcweir void OApplicationDetailView::elementRemoved(ElementType _eType,const ::rtl::OUString& _rName )
956cdf0e10cSrcweir {
957cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
958cdf0e10cSrcweir m_pControlHelper->elementRemoved(_eType,_rName );
959cdf0e10cSrcweir }
960cdf0e10cSrcweir // -----------------------------------------------------------------------------
elementReplaced(ElementType _eType,const::rtl::OUString & _rOldName,const::rtl::OUString & _rNewName)961cdf0e10cSrcweir void OApplicationDetailView::elementReplaced(ElementType _eType
962cdf0e10cSrcweir ,const ::rtl::OUString& _rOldName
963cdf0e10cSrcweir ,const ::rtl::OUString& _rNewName )
964cdf0e10cSrcweir {
965cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
966cdf0e10cSrcweir m_pControlHelper->elementReplaced( _eType, _rOldName, _rNewName );
967cdf0e10cSrcweir }
968cdf0e10cSrcweir // -----------------------------------------------------------------------------
getPreviewMode()969cdf0e10cSrcweir PreviewMode OApplicationDetailView::getPreviewMode()
970cdf0e10cSrcweir {
971cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
972cdf0e10cSrcweir return m_pControlHelper->getPreviewMode();
973cdf0e10cSrcweir }
974cdf0e10cSrcweir // -----------------------------------------------------------------------------
isPreviewEnabled()975cdf0e10cSrcweir sal_Bool OApplicationDetailView::isPreviewEnabled()
976cdf0e10cSrcweir {
977cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
978cdf0e10cSrcweir return m_pControlHelper->isPreviewEnabled();
979cdf0e10cSrcweir }
980cdf0e10cSrcweir // -----------------------------------------------------------------------------
switchPreview(PreviewMode _eMode)981cdf0e10cSrcweir void OApplicationDetailView::switchPreview(PreviewMode _eMode)
982cdf0e10cSrcweir {
983cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
984cdf0e10cSrcweir m_pControlHelper->switchPreview(_eMode);
985cdf0e10cSrcweir }
986cdf0e10cSrcweir // -----------------------------------------------------------------------------
showPreview(const Reference<XContent> & _xContent)987cdf0e10cSrcweir void OApplicationDetailView::showPreview(const Reference< XContent >& _xContent)
988cdf0e10cSrcweir {
989cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
990cdf0e10cSrcweir m_pControlHelper->showPreview(_xContent);
991cdf0e10cSrcweir }
992cdf0e10cSrcweir // -----------------------------------------------------------------------------
showPreview(const::rtl::OUString & _sDataSourceName,const::rtl::OUString & _sName,sal_Bool _bTable)993cdf0e10cSrcweir void OApplicationDetailView::showPreview( const ::rtl::OUString& _sDataSourceName,
994cdf0e10cSrcweir const ::rtl::OUString& _sName,
995cdf0e10cSrcweir sal_Bool _bTable)
996cdf0e10cSrcweir {
997cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
998cdf0e10cSrcweir m_pControlHelper->showPreview(_sDataSourceName,_sName,_bTable);
999cdf0e10cSrcweir }
1000cdf0e10cSrcweir // -----------------------------------------------------------------------------
isSortUp() const1001cdf0e10cSrcweir sal_Bool OApplicationDetailView::isSortUp() const
1002cdf0e10cSrcweir {
1003cdf0e10cSrcweir DBG_CHKTHIS(OApplicationDetailView,NULL);
1004cdf0e10cSrcweir return m_pControlHelper->isSortUp();
1005cdf0e10cSrcweir }
1006cdf0e10cSrcweir // -----------------------------------------------------------------------------
getTreeWindow() const1007cdf0e10cSrcweir Window* OApplicationDetailView::getTreeWindow() const
1008cdf0e10cSrcweir {
1009cdf0e10cSrcweir return m_pControlHelper->getCurrentView();
1010cdf0e10cSrcweir }
1011cdf0e10cSrcweir
1012