Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / include / framework / framecontainer.hxx
blob1678a867006729415b6005aa1bea1a51b0665ba2
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 #pragma once
22 #include <sal/config.h>
24 #include <vector>
26 #include <com/sun/star/frame/XFrame.hpp>
27 #include <com/sun/star/uno/Reference.hxx>
29 #include <rtl/ustring.hxx>
31 namespace framework{
33 typedef ::std::vector< css::uno::Reference< css::frame::XFrame > > TFrameContainer;
35 /*-************************************************************************************************************
36 @short implement a container to hold children of frame, task or desktop
37 @descr Every object of frame, task or desktop hold reference to its children. These container is used as helper
38 to do this. Some helper-classes like OFrames or OTasksAccess use it to. They hold a pointer to an instance
39 of this class, which is a member of a frame, task or desktop! You can append and remove frames.
40 It's possible to set one of these frames as active or deactivate. You could have full index-access to
41 container-items.
43 @devstatus ready to use
44 @threadsafe yes
45 *//*-*************************************************************************************************************/
46 class FrameContainer final
49 // member
51 private:
53 /// list to hold all frames
54 TFrameContainer m_aContainer;
55 /// one container item can be the current active frame. It's necessary for Desktop or Frame implementation.
56 css::uno::Reference< css::frame::XFrame > m_xActiveFrame;
58 // interface
60 public:
62 /// constructor / destructor
63 FrameContainer();
64 ~FrameContainer();
66 /// add/remove/mark container items
67 void append ( const css::uno::Reference< css::frame::XFrame >& xFrame );
68 void remove ( const css::uno::Reference< css::frame::XFrame >& xFrame );
69 void setActive ( const css::uno::Reference< css::frame::XFrame >& xFrame );
70 css::uno::Reference< css::frame::XFrame > getActive ( ) const;
72 /// checks and free memory
73 bool exist ( const css::uno::Reference< css::frame::XFrame >& xFrame ) const;
74 void clear ( );
76 /// deprecated IndexAccess!
77 sal_uInt32 getCount ( ) const;
78 css::uno::Reference< css::frame::XFrame > operator[]( sal_uInt32 nIndex ) const;
80 /// replacement for deprecated index access
81 css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > getAllElements() const;
83 /// special helper for Frame::findFrame()
84 css::uno::Reference< css::frame::XFrame > searchOnAllChildrens ( const OUString& sName ) const;
85 css::uno::Reference< css::frame::XFrame > searchOnDirectChildrens( std::u16string_view sName ) const;
87 }; // class FrameContainer
89 } // namespace framework
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */