LibreOffice Module framework (master) 1
oframes.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
23
24#include <com/sun/star/frame/XFrames.hpp>
25#include <com/sun/star/frame/XFrame.hpp>
26
29
30namespace framework{
31
44class OFrames final : public ::cppu::WeakImplHelper< css::frame::XFrames >
45{
46 public:
47
55 OFrames( const css::uno::Reference< css::frame::XFrame >& xOwner ,
56 FrameContainer* pFrameContainer );
57
58 // XFrames
59
70 virtual void SAL_CALL append( const css::uno::Reference< css::frame::XFrame >& xFrame ) override;
71
82 virtual void SAL_CALL remove( const css::uno::Reference< css::frame::XFrame >& xFrame ) override;
83
92 virtual css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > SAL_CALL queryFrames( sal_Int32 nSearchFlags ) override;
93
94 // XIndexAccess
95
107 virtual sal_Int32 SAL_CALL getCount() override;
108
123 virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 nIndex ) override;
124
125 // XElementAccess
126
133 virtual css::uno::Type SAL_CALL getElementType() override;
134
144 virtual sal_Bool SAL_CALL hasElements() override;
145
146 private:
147
154 virtual ~OFrames() override;
155
166 void impl_resetObject();
167
178 void impl_appendSequence( css::uno::Sequence< css::uno::Reference< css::frame::XFrame > >& seqDestination ,
179 const css::uno::Sequence< css::uno::Reference< css::frame::XFrame > >& seqSource );
180
181 static bool impldbg_checkParameter_queryFrames ( sal_Int32 nSearchFlags );
182
183 css::uno::WeakReference< css::frame::XFrame > m_xOwner;
186};
187
188}
189
190/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
implement XFrames, XIndexAccess and XElementAccess interfaces as helper for services @descr Use this ...
Definition: oframes.hxx:45
virtual void SAL_CALL append(const css::uno::Reference< css::frame::XFrame > &xFrame) override
append frame to container @descr We share the container with our owner.
Definition: oframes.cxx:59
virtual sal_Bool SAL_CALL hasElements() override
get fill state of current container @descr Call these to get information about, if items exist in con...
Definition: oframes.cxx:256
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override
get specified container item by index @descr If you called getCount() successful - this method return...
Definition: oframes.cxx:222
void impl_resetObject()
reset instance to default values @descr There are two ways to delete an instance of this class.
Definition: oframes.cxx:280
virtual sal_Int32 SAL_CALL getCount() override
get count of all current frames in container @descr This is the beginning of full index-access.
Definition: oframes.cxx:200
void impl_appendSequence(css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > &seqDestination, const css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > &seqSource)
append one sequence to another @descr There is no operation to add to sequences! Use this helper-meth...
Definition: oframes.cxx:294
bool m_bRecursiveSearchProtection
with owner shared list to hold all direct children of an XFramesSupplier
Definition: oframes.hxx:185
virtual css::uno::Type SAL_CALL getElementType() override
get uno-type of all container items @descr In current implementation type is fixed to XFrame!...
Definition: oframes.cxx:249
css::uno::WeakReference< css::frame::XFrame > m_xOwner
Definition: oframes.hxx:183
virtual void SAL_CALL remove(const css::uno::Reference< css::frame::XFrame > &xFrame) override
remove frame from container @descr This is the companion to append().
Definition: oframes.cxx:82
static bool impldbg_checkParameter_queryFrames(sal_Int32 nSearchFlags)
Definition: oframes.cxx:344
OFrames(const css::uno::Reference< css::frame::XFrame > &xOwner, FrameContainer *pFrameContainer)
standard ctor @descr These initialize a new instance of this class with all needed information for wo...
Definition: oframes.cxx:38
FrameContainer * m_pFrameContainer
reference to owner of this instance (Hold no hard reference!)
Definition: oframes.hxx:184
virtual css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > SAL_CALL queryFrames(sal_Int32 nSearchFlags) override
return list of all applicable frames for given flags @descr Call these to get a list of all frames,...
Definition: oframes.cxx:106
virtual ~OFrames() override
standard destructor @descr This method destruct an instance of this class and clear some member.
Definition: oframes.cxx:52
sal_Int32 nIndex
Reference< XFrame > xFrame
unsigned char sal_Bool