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