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#include <unotools/resmgr.hxx>
24
25class ScDocument;
26class ScViewFunc;
27class ScMarkData;
28
29namespace sc {
30
31enum class ColRowEditAction;
32
33}
34
36{
39
40public:
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
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
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; }
87};
88
89/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void TestSelection(const ScDocument &rDoc, const ScMarkData &rMark)
Definition: editable.cxx:123
bool IsFormatEditable() const
Definition: editable.hxx:85
bool IsEditable() const
Definition: editable.hxx:84
TranslateId GetMessageId() const
Definition: editable.cxx:152
void TestBlock(const ScDocument &rDoc, SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, bool bNoMatrixAtAll=false)
Definition: editable.cxx:82
void TestRange(const ScDocument &rDoc, const ScRange &rRange)
Definition: editable.cxx:111
void TestBlockForAction(const ScDocument &rDoc, sc::ColRowEditAction eAction, SCCOLROW nStart, SCCOLROW nEnd, const ScMarkData &rMark)
Definition: editable.cxx:137
void TestSelectedBlock(const ScDocument &rDoc, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, const ScMarkData &rMark)
Definition: editable.cxx:97
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
Definition: markdata.hxx:43
CAUTION! The following defines must be in the same namespace as the respective type.
Definition: broadcast.cxx:15
ColRowEditAction
Definition: global.hxx:427
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
Definition: types.hxx:23
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17