1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_FRAMEWORK_INC_CLASSES_FRAMECONTAINER_HXX
21 #define INCLUDED_FRAMEWORK_INC_CLASSES_FRAMECONTAINER_HXX
23 /** Attention: stl headers must(!) be included at first. Otherwise it can make trouble
24 with solaris headers ...
30 #include <threadhelp/transactionbase.hxx>
33 #include <com/sun/star/frame/XFrame.hpp>
34 #include <com/sun/star/frame/XDesktop.hpp>
35 #include <com/sun/star/uno/Reference.hxx>
37 #include <cppuhelper/weakref.hxx>
38 #include <rtl/ustring.hxx>
39 #include <vcl/evntpost.hxx>
43 typedef ::std::vector
< css::uno::Reference
< css::frame::XFrame
> > TFrameContainer
;
44 typedef TFrameContainer::iterator TFrameIterator
;
45 typedef TFrameContainer::const_iterator TConstFrameIterator
;
47 /*-************************************************************************************************************
48 @short implement a container to hold children of frame, task or desktop
49 @descr Every object of frame, task or desktop hold reference to his children. These container is used as helper
50 to do this. Some helper-classe like OFrames or OTasksAccess use it to. They hold a pointer to an instance
51 of this class, which is a member of a frame, task or desktop! You can append and remove frames.
52 It's possible to set one of these frames as active or deactive. You could have full index-access to
55 @devstatus ready to use
57 *//*-*************************************************************************************************************/
65 /// list to hold all frames
66 TFrameContainer m_aContainer
;
67 /// one container item can be the current active frame. Its necessary for Desktop or Frame implementation.
68 css::uno::Reference
< css::frame::XFrame
> m_xActiveFrame
;
74 /// constructor / destructor
76 virtual ~FrameContainer();
78 /// add/remove/mark container items
79 void append ( const css::uno::Reference
< css::frame::XFrame
>& xFrame
);
80 void remove ( const css::uno::Reference
< css::frame::XFrame
>& xFrame
);
81 void setActive ( const css::uno::Reference
< css::frame::XFrame
>& xFrame
);
82 css::uno::Reference
< css::frame::XFrame
> getActive ( ) const;
84 /// checks and free memory
85 bool exist ( const css::uno::Reference
< css::frame::XFrame
>& xFrame
) const;
88 /// deprecated IndexAccess!
89 sal_uInt32
getCount ( ) const;
90 css::uno::Reference
< css::frame::XFrame
> operator[]( sal_uInt32 nIndex
) const;
92 /// replacement for deprectaed index access
93 css::uno::Sequence
< css::uno::Reference
< css::frame::XFrame
> > getAllElements() const;
95 /// special helper for Frame::findFrame()
96 css::uno::Reference
< css::frame::XFrame
> searchOnAllChildrens ( const OUString
& sName
) const;
97 css::uno::Reference
< css::frame::XFrame
> searchOnDirectChildrens( const OUString
& sName
) const;
99 }; // class FrameContainer
101 } // namespace framework
103 #endif // INCLUDED_FRAMEWORK_INC_CLASSES_FRAMECONTAINER_HXX
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */