LibreOffice Module sc (master)  1
editable.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 
22 #include <address.hxx>
23 
24 class ScDocument;
25 class ScViewFunc;
26 class ScMarkData;
27 
28 namespace sc {
29 
30 enum class ColRowEditAction;
31 
32 }
33 
35 {
38 
39 public:
41 
42  // calls TestBlock
46  ScEditableTester( const ScDocument& rDoc, SCTAB nTab,
47  SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
48  bool bNoMatrixAtAll = false );
49 
50  // calls TestSelectedBlock
51  ScEditableTester( const ScDocument& rDoc,
52  SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
53  const ScMarkData& rMark );
54 
55  // calls TestRange
56  ScEditableTester( const ScDocument& rDoc, const ScRange& rRange );
57 
58  // calls TestSelection
59  ScEditableTester( const ScDocument& rDoc, const ScMarkData& rMark );
60 
61  // calls TestView
62  ScEditableTester( ScViewFunc* pView );
63 
65  const ScDocument& rDoc, sc::ColRowEditAction eAction, SCCOLROW nStart, SCCOLROW nEnd,
66  const ScMarkData& rMark );
67 
68  // Several calls to the Test... methods check if *all* of the ranges
69  // are editable. For several independent checks, Reset() has to be used.
70  void TestBlock( const ScDocument& rDoc, SCTAB nTab,
71  SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
72  bool bNoMatrixAtAll = false );
73  void TestSelectedBlock( const ScDocument& rDoc,
74  SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
75  const ScMarkData& rMark );
76  void TestRange( const ScDocument& rDoc, const ScRange& rRange );
77  void TestSelection( const ScDocument& rDoc, const ScMarkData& rMark );
78 
79  void TestBlockForAction(
80  const ScDocument& rDoc, sc::ColRowEditAction eAction, SCCOLROW nStart, SCCOLROW nEnd,
81  const ScMarkData& rMark );
82 
83  bool IsEditable() const { return mbIsEditable; }
84  bool IsFormatEditable() const { return mbIsEditable || mbOnlyMatrix; }
85  const char* GetMessageId() const;
86 };
87 
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void TestBlockForAction(const ScDocument &rDoc, sc::ColRowEditAction eAction, SCCOLROW nStart, SCCOLROW nEnd, const ScMarkData &rMark)
Definition: editable.cxx:137
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
Definition: markdata.hxx:42
void TestSelection(const ScDocument &rDoc, const ScMarkData &rMark)
Definition: editable.cxx:123
bool IsFormatEditable() const
Definition: editable.hxx:84
void TestBlock(const ScDocument &rDoc, SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, bool bNoMatrixAtAll=false)
Definition: editable.cxx:82
void TestSelectedBlock(const ScDocument &rDoc, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, const ScMarkData &rMark)
Definition: editable.cxx:97
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
Definition: types.hxx:23
const char * GetMessageId() const
Definition: editable.cxx:152
sal_Int16 SCCOL
Definition: types.hxx:21
bool IsEditable() const
Definition: editable.hxx:83
sal_Int32 SCROW
Definition: types.hxx:17
ColRowEditAction
Definition: global.hxx:435
void TestRange(const ScDocument &rDoc, const ScRange &rRange)
Definition: editable.cxx:111
sal_Int16 SCTAB
Definition: types.hxx:22