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 #ifndef INCLUDED_SC_SOURCE_UI_INC_EDITABLE_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_EDITABLE_HXX
22 
23 #include <address.hxx>
24 
25 class ScDocument;
26 class ScViewFunc;
27 class ScMarkData;
28 
29 namespace sc {
30 
31 enum class ColRowEditAction;
32 
33 }
34 
36 {
39 
40 public:
42 
43  // calls TestBlock
47  ScEditableTester( const ScDocument& rDoc, SCTAB nTab,
48  SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
49  bool bNoMatrixAtAll = false );
50 
51  // calls TestSelectedBlock
52  ScEditableTester( const ScDocument& rDoc,
53  SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
54  const ScMarkData& rMark );
55 
56  // calls TestRange
57  ScEditableTester( const ScDocument& rDoc, const ScRange& rRange );
58 
59  // calls TestSelection
60  ScEditableTester( const ScDocument& rDoc, const ScMarkData& rMark );
61 
62  // calls TestView
63  ScEditableTester( ScViewFunc* pView );
64 
66  const ScDocument& rDoc, sc::ColRowEditAction eAction, SCCOLROW nStart, SCCOLROW nEnd,
67  const ScMarkData& rMark );
68 
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 TestSelectedBlock( const ScDocument& rDoc,
75  SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
76  const ScMarkData& rMark );
77  void TestRange( const ScDocument& rDoc, const ScRange& rRange );
78  void TestSelection( const ScDocument& rDoc, const ScMarkData& rMark );
79 
80  void TestBlockForAction(
81  const ScDocument& rDoc, sc::ColRowEditAction eAction, SCCOLROW nStart, SCCOLROW nEnd,
82  const ScMarkData& rMark );
83 
84  bool IsEditable() const { return mbIsEditable; }
85  bool IsFormatEditable() const { return mbIsEditable || mbOnlyMatrix; }
86  const char* GetMessageId() const;
87 };
88 
89 #endif
90 
91 /* 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:43
void TestSelection(const ScDocument &rDoc, const ScMarkData &rMark)
Definition: editable.cxx:123
bool IsFormatEditable() const
Definition: editable.hxx:85
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:24
const char * GetMessageId() const
Definition: editable.cxx:152
sal_Int16 SCCOL
Definition: types.hxx:22
bool IsEditable() const
Definition: editable.hxx:84
sal_Int32 SCROW
Definition: types.hxx:18
ColRowEditAction
Definition: global.hxx:435
void TestRange(const ScDocument &rDoc, const ScRange &rRange)
Definition: editable.cxx:111
sal_Int16 SCTAB
Definition: types.hxx:23