87a1d6808f
2004/05/17 09:37:55 af 1.7.100.1: #116371# Base class is DrawController instead of DrawSubController.
250 lines
6.5 KiB
C++
250 lines
6.5 KiB
C++
/*************************************************************************
|
|
*
|
|
* $RCSfile: SdUnoOutlineView.cxx,v $
|
|
*
|
|
* $Revision: 1.8 $
|
|
*
|
|
* last change: $Author: obo $ $Date: 2004-06-03 11:56:34 $
|
|
*
|
|
* The Contents of this file are made available subject to the terms of
|
|
* either of the following licenses
|
|
*
|
|
* - GNU Lesser General Public License Version 2.1
|
|
* - Sun Industry Standards Source License Version 1.1
|
|
*
|
|
* Sun Microsystems Inc., October, 2000
|
|
*
|
|
* GNU Lesser General Public License Version 2.1
|
|
* =============================================
|
|
* Copyright 2000 by Sun Microsystems, Inc.
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License version 2.1, as published by the Free Software Foundation.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
* MA 02111-1307 USA
|
|
*
|
|
*
|
|
* Sun Industry Standards Source License Version 1.1
|
|
* =================================================
|
|
* The contents of this file are subject to the Sun Industry Standards
|
|
* Source License Version 1.1 (the "License"); You may not use this file
|
|
* except in compliance with the License. You may obtain a copy of the
|
|
* License at http://www.openoffice.org/license.html.
|
|
*
|
|
* Software provided under this License is provided on an "AS IS" basis,
|
|
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
|
|
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
|
|
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
|
|
* See the License for the specific provisions governing your rights and
|
|
* obligations concerning the Software.
|
|
*
|
|
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
|
|
*
|
|
* Copyright: 2000 by Sun Microsystems, Inc.
|
|
*
|
|
* All Rights Reserved.
|
|
*
|
|
* Contributor(s): _______________________________________
|
|
*
|
|
*
|
|
************************************************************************/
|
|
|
|
#include "SdUnoOutlineView.hxx"
|
|
|
|
#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
|
|
#include <com/sun/star/beans/PropertyAttribute.hpp>
|
|
#endif
|
|
|
|
#ifndef _SVX_UNOSHAPE_HXX
|
|
#include <svx/unoshape.hxx>
|
|
#endif
|
|
|
|
#include <svx/svdobj.hxx>
|
|
#include <svx/svdpagv.hxx>
|
|
#include <svx/unoshape.hxx>
|
|
#include <svx/unoshcol.hxx>
|
|
|
|
#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
|
|
#include <toolkit/helper/vclunohelper.hxx>
|
|
#endif
|
|
|
|
#ifndef SD_WINDOW_HXX
|
|
#include "Window.hxx"
|
|
#endif
|
|
#ifndef SD_OUTLINE_VIEW_SHELL_HXX
|
|
#include "OutlineViewShell.hxx"
|
|
#endif
|
|
#include "unohelp.hxx"
|
|
#include "unopage.hxx"
|
|
#include "unomodel.hxx"
|
|
#ifndef SD_VIEW_HXX
|
|
#include "View.hxx"
|
|
#endif
|
|
#ifndef SD_DRAW_VIEW_SHELL_HXX
|
|
#include "DrawViewShell.hxx"
|
|
#endif
|
|
#include "drawdoc.hxx"
|
|
#ifndef SD_DRAW_DOC_SHELL_HXX
|
|
#include "DrawDocShell.hxx"
|
|
#endif
|
|
#ifndef SD_GRAPHIC_VIEW_SHELL_HXX
|
|
#include "GraphicViewShell.hxx"
|
|
#endif
|
|
#ifndef SD_PRESENTATION_VIEW_SHELL_HXX
|
|
#include "PresentationViewShell.hxx"
|
|
#endif
|
|
#ifndef SD_PREVIEW_VIEW_SHELL_HXX
|
|
#include "PreviewViewShell.hxx"
|
|
#endif
|
|
|
|
using namespace ::rtl;
|
|
using namespace ::vos;
|
|
using namespace ::cppu;
|
|
using namespace ::com::sun::star;
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
namespace sd {
|
|
|
|
//----------------------------------------------------------------------
|
|
//------ SdUnoOutlineView--------------------------------------------------
|
|
//----------------------------------------------------------------------
|
|
|
|
SdUnoOutlineView::SdUnoOutlineView(
|
|
ViewShellBase& rBase,
|
|
OutlineViewShell& rViewShell,
|
|
View& rView) throw()
|
|
: DrawController (rBase, rViewShell, rView)
|
|
{
|
|
}
|
|
|
|
|
|
|
|
|
|
SdUnoOutlineView::~SdUnoOutlineView() throw()
|
|
{
|
|
}
|
|
|
|
|
|
|
|
|
|
OutlineViewShell& SdUnoOutlineView::GetDrawViewShell (void) const
|
|
{
|
|
return static_cast<OutlineViewShell&>(mrViewShell);
|
|
}
|
|
|
|
|
|
|
|
|
|
// XTypeProvider
|
|
|
|
IMPLEMENT_GET_IMPLEMENTATION_ID(SdUnoOutlineView);
|
|
|
|
|
|
|
|
|
|
|
|
// XServiceInfo
|
|
|
|
|
|
sal_Char pImplSdUnoOutlineViewService[sizeof("com.sun.star.presentation.OutlineView")] = "com.sun.star.presentation.OutlineView";
|
|
|
|
OUString SAL_CALL SdUnoOutlineView::getImplementationName( ) throw(RuntimeException)
|
|
{
|
|
return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdUnoOutlineView" ) );
|
|
}
|
|
|
|
|
|
|
|
|
|
sal_Bool SAL_CALL SdUnoOutlineView::supportsService( const OUString& ServiceName ) throw(RuntimeException)
|
|
{
|
|
return ServiceName.equalsAscii( pImplSdUnoOutlineViewService );
|
|
}
|
|
|
|
|
|
|
|
|
|
Sequence< OUString > SAL_CALL SdUnoOutlineView::getSupportedServiceNames( ) throw(RuntimeException)
|
|
{
|
|
OUString aService( RTL_CONSTASCII_USTRINGPARAM( pImplSdUnoOutlineViewService ) );
|
|
Sequence< OUString > aSeq( &aService, 1 );
|
|
return aSeq;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// XSelectionSupplier
|
|
|
|
|
|
sal_Bool SAL_CALL SdUnoOutlineView::select( const Any& aSelection )
|
|
throw(lang::IllegalArgumentException, RuntimeException)
|
|
{
|
|
// todo: add selections for text ranges
|
|
return sal_False;
|
|
}
|
|
|
|
|
|
|
|
Any SAL_CALL SdUnoOutlineView::getSelection()
|
|
throw(RuntimeException)
|
|
{
|
|
Any aAny;
|
|
return aAny;
|
|
}
|
|
|
|
|
|
|
|
inline const ::com::sun::star::uno::Type & getSelectionTypeIdentifier()
|
|
{
|
|
return ::getCppuType( (Reference< view::XSelectionChangeListener > *)0 );
|
|
}
|
|
|
|
|
|
|
|
void SAL_CALL SdUnoOutlineView::addSelectionChangeListener( const Reference< view::XSelectionChangeListener >& xListener )
|
|
throw(RuntimeException)
|
|
{
|
|
addListener( getSelectionTypeIdentifier(), xListener );
|
|
}
|
|
|
|
|
|
|
|
void SAL_CALL SdUnoOutlineView::removeSelectionChangeListener( const Reference< view::XSelectionChangeListener >& xListener ) throw(RuntimeException)
|
|
{
|
|
removeListener( getSelectionTypeIdentifier( ), xListener );
|
|
}
|
|
|
|
|
|
|
|
void SdUnoOutlineView::fireSelectionChangeListener() throw()
|
|
{
|
|
OInterfaceContainerHelper * pLC = getContainer( getSelectionTypeIdentifier() );
|
|
if( pLC )
|
|
{
|
|
Reference< XInterface > xSource( (XWeak*)this );
|
|
const lang::EventObject aEvent( xSource );
|
|
|
|
// Ueber alle Listener iterieren und Events senden
|
|
OInterfaceIteratorHelper aIt( *pLC);
|
|
while( aIt.hasMoreElements() )
|
|
{
|
|
view::XSelectionChangeListener * pL = (view::XSelectionChangeListener *)aIt.next();
|
|
pL->selectionChanged( aEvent );
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
} // end of namespace sd
|