LibreOffice Module framework (master) 1
framecontainer.hxx
Go to the documentation of this file.
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#pragma once
21
22#include <sal/config.h>
23
24#include <vector>
25
26#include <com/sun/star/frame/XFrame.hpp>
27#include <com/sun/star/uno/Reference.hxx>
28
29#include <rtl/ustring.hxx>
30
31namespace framework{
32
33typedef ::std::vector< css::uno::Reference< css::frame::XFrame > > TFrameContainer;
34
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.
42
43 @devstatus ready to use
44 @threadsafe yes
45*//*-*************************************************************************************************************/
46class FrameContainer final
47{
48
49 // member
50
51 private:
52
56 css::uno::Reference< css::frame::XFrame > m_xActiveFrame;
57
58 // interface
59
60 public:
61
65
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;
71
73 bool exist ( const css::uno::Reference< css::frame::XFrame >& xFrame ) const;
74 void clear ( );
75
77 sal_uInt32 getCount ( ) const;
78 css::uno::Reference< css::frame::XFrame > operator[]( sal_uInt32 nIndex ) const;
79
81 css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > getAllElements() const;
82
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;
86
87}; // class FrameContainer
88
89} // namespace framework
90
91/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void clear()
-****************************************************************************************************...
css::uno::Reference< css::frame::XFrame > operator[](sal_uInt32 nIndex) const
-****************************************************************************************************...
void append(const css::uno::Reference< css::frame::XFrame > &xFrame)
add/remove/mark container items
void setActive(const css::uno::Reference< css::frame::XFrame > &xFrame)
-****************************************************************************************************...
bool exist(const css::uno::Reference< css::frame::XFrame > &xFrame) const
checks and free memory
sal_uInt32 getCount() const
deprecated IndexAccess!
TFrameContainer m_aContainer
list to hold all frames
css::uno::Reference< css::frame::XFrame > searchOnAllChildrens(const OUString &sName) const
special helper for Frame::findFrame()
css::uno::Reference< css::frame::XFrame > getActive() const
-****************************************************************************************************...
FrameContainer()
constructor / destructor
void remove(const css::uno::Reference< css::frame::XFrame > &xFrame)
-****************************************************************************************************...
~FrameContainer()
-****************************************************************************************************...
css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > getAllElements() const
replacement for deprecated index access
css::uno::Reference< css::frame::XFrame > m_xActiveFrame
one container item can be the current active frame. It's necessary for Desktop or Frame implementatio...
css::uno::Reference< css::frame::XFrame > searchOnDirectChildrens(std::u16string_view sName) const
-****************************************************************************************************...
::std::vector< css::uno::Reference< css::frame::XFrame > > TFrameContainer