LibreOffice Module sw (master) 1
swselectionlist.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#ifndef INCLUDED_SW_SOURCE_CORE_INC_SWSELECTIONLIST_HXX
20#define INCLUDED_SW_SOURCE_CORE_INC_SWSELECTIONLIST_HXX
21
22#include <list>
23
24class SwPaM;
25class SwFrame;
26
41{
42 std::list<SwPaM*> m_aList; // container for the selected text portions
43 const SwFrame* m_pContext; // the context of these text portions
44public:
51 explicit SwSelectionList(const SwFrame* pInitCxt);
52
55 std::list<SwPaM*>::iterator getStart() { return m_aList.begin(); }
56
59 std::list<SwPaM*>::iterator getEnd() { return m_aList.end(); }
60
66 void insertPaM(SwPaM* pPam) { m_aList.push_front(pPam); }
67
72 bool isEmpty() const { return m_aList.empty(); }
73
86 bool checkContext(const SwFrame* pCheck);
87};
88
89#endif // INCLUDED_SW_SOURCE_CORE_INC_SWSELECTIONLIST_HXX
90
91/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Base class of the Writer layout elements.
Definition: frame.hxx:315
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:188
This class is used as parameter for creation of a block cursor selection.
const SwFrame * m_pContext
std::list< SwPaM * >::iterator getStart()
Start of the container for the selected text portions.
std::list< SwPaM * > m_aList
void insertPaM(SwPaM *pPam)
Adds a text portion to the selection list.
std::list< SwPaM * >::iterator getEnd()
End of the container for the selected text portions.
bool checkContext(const SwFrame *pCheck)
Checks if the context of the list is equal to the context of the frame.
bool isEmpty() const
Reports if the list does not contain any text portion.
SwSelectionList(const SwFrame *pInitCxt)
Ctor to create an empty list for a given context.