Version 7.5.1.1, tag libreoffice-7.5.1.1
[LibreOffice.git] / sc / inc / detdata.hxx
blobd9eeea6ad99649910161788a71b82c3866736cfa
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 "global.hxx"
24 #include <vector>
26 enum ScDetOpType
28 SCDETOP_ADDSUCC,
29 SCDETOP_DELSUCC,
30 SCDETOP_ADDPRED,
31 SCDETOP_DELPRED,
32 SCDETOP_ADDERROR
35 class ScDetOpData
37 ScAddress aPos;
38 ScDetOpType eOperation;
40 public:
41 ScDetOpData( const ScAddress& rP, ScDetOpType eOp ) :
42 aPos(rP), eOperation(eOp) {}
44 const ScAddress& GetPos() const { return aPos; }
45 ScDetOpType GetOperation() const { return eOperation; }
47 // for UpdateRef:
48 void SetPos(const ScAddress& rNew) { aPos=rNew; }
50 bool operator== ( const ScDetOpData& r ) const
51 { return eOperation == r.eOperation && aPos == r.aPos; }
54 // list of operators
56 typedef std::vector<ScDetOpData> ScDetOpDataVector;
58 class ScDetOpList
60 bool bHasAddError; // updated in append
61 ScDetOpDataVector aDetOpDataVector;
63 public:
64 ScDetOpList() : bHasAddError(false) {}
65 ScDetOpList(const ScDetOpList& rList);
67 void DeleteOnTab( SCTAB nTab );
68 void UpdateReference( const ScDocument* pDoc, UpdateRefMode eUpdateRefMode,
69 const ScRange& rRange, SCCOL nDx, SCROW nDy, SCTAB nDz );
71 bool operator==( const ScDetOpList& r ) const; // for ref-undo
73 void Append( const ScDetOpData& );
74 ScDetOpDataVector& GetDataVector() { return aDetOpDataVector; }
75 const ScDetOpData& GetObject( size_t nPos ) const;
77 bool HasAddError() const { return bHasAddError; }
78 size_t Count() const { return aDetOpDataVector.size(); }
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */