1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include <address.hxx>
23 #include <unotools/resmgr.hxx>
31 enum class EditAction
;
35 class ScEditableTester
44 /** @param bNoMatrixAtAll
45 TRUE if there must not be any matrix, not even entirely
46 contained; for example in sorting. */
47 ScEditableTester( const ScDocument
& rDoc
, SCTAB nTab
,
48 SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
,
49 bool bNoMatrixAtAll
= false );
51 // calls TestSelectedBlock
52 ScEditableTester( const ScDocument
& rDoc
,
53 SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
,
54 const ScMarkData
& rMark
);
57 ScEditableTester( const ScDocument
& rDoc
, const ScRange
& rRange
, sc::EditAction eAction
);
59 // calls TestSelection
60 ScEditableTester( const ScDocument
& rDoc
, const ScMarkData
& rMark
);
63 ScEditableTester( ScViewFunc
* pView
);
66 const ScDocument
& rDoc
, sc::EditAction eAction
, SCCOL nStartCol
,
67 SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
, const ScMarkData
& rMark
);
69 // Several calls to the Test... methods check if *all* of the ranges
70 // are editable. For several independent checks, Reset() has to be used.
71 void TestBlock( const ScDocument
& rDoc
, SCTAB nTab
,
72 SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
,
73 bool bNoMatrixAtAll
= false );
74 void TestBlockForAction( const ScDocument
& rDoc
, SCTAB nTab
,
75 SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
,
76 sc::EditAction eAction
);
77 void TestSelectedBlock( const ScDocument
& rDoc
,
78 SCCOL nStartCol
, SCROW nStartRow
, SCCOL nEndCol
, SCROW nEndRow
,
79 const ScMarkData
& rMark
);
80 void TestRange( const ScDocument
& rDoc
, const ScRange
& rRange
);
81 void TestRangeForAction( const ScDocument
& rDoc
, const ScRange
& rRange
,
82 sc::EditAction eAction
);
83 void TestSelection( const ScDocument
& rDoc
, const ScMarkData
& rMark
);
85 void TestBlockForAction(
86 const ScDocument
& rDoc
, sc::EditAction eAction
, SCCOL nStartCol
, SCROW nStartRow
,
87 SCCOL nEndCol
, SCROW nEndRow
, const ScMarkData
& rMark
);
89 bool IsEditable() const { return mbIsEditable
; }
90 bool IsFormatEditable() const { return mbIsEditable
|| mbOnlyMatrix
; }
91 TranslateId
GetMessageId() const;
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */