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 
24 class SwPaM;
25 class SwFrame;
26 
41 {
42  std::list< SwPaM* > aList; // container for the selected text portions
43  const SwFrame* pContext; // the context of these text portions
44 public:
51  explicit SwSelectionList( const SwFrame* pInitCxt );
52 
55  std::list<SwPaM*>::iterator getStart() { return aList.begin(); }
56 
59  std::list<SwPaM*>::iterator getEnd() { return aList.end(); }
60 
66  void insertPaM( SwPaM* pPam ) { aList.push_front( pPam ); }
67 
72  bool isEmpty() const { return 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:295
std::list< SwPaM * >::iterator getEnd()
End of the container for the selected text portions.
This class is used as parameter for creation of a block cursor selection.
bool checkContext(const SwFrame *pCheck)
Checks if the context of the list is equal to the context of the frame.
void insertPaM(SwPaM *pPam)
Adds a text portion to the selection list.
std::list< SwPaM * >::iterator getStart()
Start of the container for the selected text portions.
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
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.
std::list< SwPaM * > aList
const SwFrame * pContext