Avoid potential negative array index access to cached text.
[LibreOffice.git] / sc / inc / hints.hxx
blob00d6d80e0fa3168e941fd41bb3435bf50b285dab
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #pragma once
22 #include "global.hxx"
23 #include "address.hxx"
24 #include <tools/solar.h>
25 #include <svl/hint.hxx>
27 class SC_DLLPUBLIC ScPaintHint final : public SfxHint
29 ScRange aRange;
30 PaintPartFlags nParts;
31 tools::Long nWidthAffectedHint;
33 public:
34 ScPaintHint() = delete;
35 ScPaintHint( const ScRange& rRng, PaintPartFlags nPaint, tools::Long nMaxWidthAffectedHint = -1);
36 virtual ~ScPaintHint() override;
38 SCCOL GetStartCol() const { return aRange.aStart.Col(); }
39 SCROW GetStartRow() const { return aRange.aStart.Row(); }
40 SCTAB GetStartTab() const { return aRange.aStart.Tab(); }
41 SCCOL GetEndCol() const { return aRange.aEnd.Col(); }
42 SCROW GetEndRow() const { return aRange.aEnd.Row(); }
43 SCTAB GetEndTab() const { return aRange.aEnd.Tab(); }
44 PaintPartFlags GetParts() const { return nParts; }
45 tools::Long GetMaxWidthAffectedHint() const { return nWidthAffectedHint; }
48 class ScUpdateRefHint final : public SfxHint
50 UpdateRefMode eUpdateRefMode;
51 ScRange aRange;
52 SCCOL nDx;
53 SCROW nDy;
54 SCTAB nDz;
56 public:
57 ScUpdateRefHint( UpdateRefMode eMode, const ScRange& rR,
58 SCCOL nX, SCROW nY, SCTAB nZ );
59 virtual ~ScUpdateRefHint() override;
61 UpdateRefMode GetMode() const { return eUpdateRefMode; }
62 const ScRange& GetRange() const { return aRange; }
63 SCCOL GetDx() const { return nDx; }
64 SCROW GetDy() const { return nDy; }
65 SCTAB GetDz() const { return nDz; }
68 //! move ScLinkRefreshedHint to a different file?
69 enum class ScLinkRefType {
70 NONE, SHEET, AREA, DDE
73 class ScLinkRefreshedHint final : public SfxHint
75 ScLinkRefType nLinkType;
76 OUString aUrl; // used for sheet links
77 OUString aDdeAppl; // used for dde links:
78 OUString aDdeTopic;
79 OUString aDdeItem;
80 ScAddress aDestPos; // used to identify area links
81 //! also use source data for area links?
83 public:
84 ScLinkRefreshedHint();
85 virtual ~ScLinkRefreshedHint() override;
87 void SetSheetLink( const OUString& rSourceUrl );
88 void SetDdeLink( const OUString& rA, const OUString& rT, const OUString& rI );
89 void SetAreaLink( const ScAddress& rPos );
91 ScLinkRefType GetLinkType() const { return nLinkType; }
92 const OUString& GetUrl() const { return aUrl; }
93 const OUString& GetDdeAppl() const { return aDdeAppl; }
94 const OUString& GetDdeTopic() const { return aDdeTopic; }
95 const OUString& GetDdeItem() const { return aDdeItem; }
96 const ScAddress& GetDestPos() const { return aDestPos; }
99 //! move ScAutoStyleHint to a different file?
101 class ScAutoStyleHint final : public SfxHint
103 ScRange aRange;
104 OUString aStyle1;
105 OUString aStyle2;
106 sal_uLong nTimeout;
108 public:
109 ScAutoStyleHint( const ScRange& rR, OUString aSt1,
110 sal_uLong nT, OUString aSt2 );
111 virtual ~ScAutoStyleHint() override;
113 const ScRange& GetRange() const { return aRange; }
114 const OUString& GetStyle1() const { return aStyle1; }
115 sal_uInt32 GetTimeout() const { return nTimeout; }
116 const OUString& GetStyle2() const { return aStyle2; }
119 class ScDBRangeRefreshedHint final : public SfxHint
121 ScImportParam aParam;
123 public:
124 ScDBRangeRefreshedHint( const ScImportParam& rP );
125 virtual ~ScDBRangeRefreshedHint() override;
127 const ScImportParam& GetImportParam() const { return aParam; }
130 class ScDataPilotModifiedHint final : public SfxHint
132 OUString maName;
134 public:
135 ScDataPilotModifiedHint( OUString aName );
136 virtual ~ScDataPilotModifiedHint() override;
138 const OUString& GetName() const { return maName; }
141 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */