update dev300-m58
[ooovba.git] / slideshow / source / inc / unoviewcontainer.hxx
blob37d81c3261134bd37d46f964cf0ba307490b74b3
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: unoviewcontainer.hxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef INCLUDED_SLIDESHOW_UNOVIEWCONTAINER_HXX
32 #define INCLUDED_SLIDESHOW_UNOVIEWCONTAINER_HXX
34 #include <com/sun/star/uno/Reference.hxx>
36 #include <boost/shared_ptr.hpp>
37 #include <boost/utility.hpp>
39 #include <vector>
41 #include "unoview.hxx"
44 namespace com { namespace sun { namespace star { namespace presentation
46 class XSlideShowView;
47 } } } }
49 /* Definition of UnoViewContainer class */
51 namespace slideshow
53 namespace internal
55 /** Contains UnoViews
57 class UnoViewContainer : private boost::noncopyable
59 public:
60 UnoViewContainer();
62 /** Add a view to this container
64 @return true, if the view was successfully added
65 (false is e.g. returned, if the view was already
66 added)
68 bool addView( const UnoViewSharedPtr& rView );
70 /** Remove a previously added a view from this container
72 @return true, if this view was successfully removed, false
73 otherwise (e.g. if this view wasn't added in the first place)
75 bool removeView( const UnoViewSharedPtr& rView );
77 /** Remove a previously added a view from this container
79 @return the View object, if this view was successfully
80 removed, and an empty shared_ptr otherwise (e.g. if
81 this view wasn't added in the first place)
83 UnoViewSharedPtr removeView( const ::com::sun::star::uno::Reference<
84 ::com::sun::star::presentation::XSlideShowView >& xView );
86 /// Dispose all stored views. Implies clear().
87 void dispose();
89 // the following parrots STL container concept methods
90 // ===================================================
92 std::size_t size() const { return maViews.size(); }
93 bool empty() const { return maViews.empty(); }
95 void clear() { maViews.clear(); }
98 UnoViewVector::iterator begin() { return maViews.begin(); }
99 UnoViewVector::const_iterator begin() const { return maViews.begin(); }
100 UnoViewVector::iterator end() { return maViews.end(); }
101 UnoViewVector::const_iterator end() const { return maViews.end(); }
103 private:
104 /// All added views
105 UnoViewVector maViews;
108 typedef ::boost::shared_ptr< UnoViewContainer > UnoViewContainerSharedPtr;
113 #endif /* INCLUDED_SLIDESHOW_UNOVIEWCONTAINER_HXX */