Line data Source code
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 SC_EDITABLE_HXX
21 : #define SC_EDITABLE_HXX
22 :
23 : #include "address.hxx"
24 : #include <tools/solar.h>
25 :
26 : class ScDocument;
27 : class ScViewFunc;
28 : class ScMarkData;
29 : class ScRange;
30 :
31 :
32 : class ScEditableTester
33 : {
34 : sal_Bool bIsEditable;
35 : sal_Bool bOnlyMatrix;
36 :
37 : public:
38 : // no test in ctor
39 : ScEditableTester();
40 :
41 : // calls TestBlock
42 : ScEditableTester( ScDocument* pDoc, SCTAB nTab,
43 : SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow );
44 :
45 : // calls TestSelectedBlock
46 : ScEditableTester( ScDocument* pDoc,
47 : SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
48 : const ScMarkData& rMark );
49 :
50 : // calls TestRange
51 : ScEditableTester( ScDocument* pDoc, const ScRange& rRange );
52 :
53 : // calls TestSelection
54 : ScEditableTester( ScDocument* pDoc, const ScMarkData& rMark );
55 :
56 : // calls TestView
57 : ScEditableTester( ScViewFunc* pView );
58 :
59 8 : ~ScEditableTester() {}
60 :
61 : // Several calls to the Test... methods check if *all* of the ranges
62 : // are editable. For several independent checks, Reset() has to be used.
63 : void TestBlock( ScDocument* pDoc, SCTAB nTab,
64 : SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow );
65 : void TestSelectedBlock( ScDocument* pDoc,
66 : SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
67 : const ScMarkData& rMark );
68 : void TestRange( ScDocument* pDoc, const ScRange& rRange );
69 : void TestSelection( ScDocument* pDoc, const ScMarkData& rMark );
70 : void TestView( ScViewFunc* pView );
71 :
72 8 : sal_Bool IsEditable() const { return bIsEditable; }
73 0 : sal_Bool IsFormatEditable() const { return bIsEditable || bOnlyMatrix; }
74 : sal_uInt16 GetMessageId() const;
75 : };
76 :
77 : #endif
78 :
79 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|