Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / inc / hints.hxx
blobaf45f86ed11131f6981c6f81843b9e94d57fde14
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 #ifndef SC_HINTS_HXX
21 #define SC_HINTS_HXX
23 #include "global.hxx"
24 #include "address.hxx"
25 #include <svl/hint.hxx>
27 class ScPaintHint : public SfxHint
29 ScRange aRange;
30 sal_uInt16 nParts;
31 sal_Bool bPrint; // flag indicating whether print/preview if affected
33 ScPaintHint(); // disabled
35 public:
36 TYPEINFO();
37 ScPaintHint( const ScRange& rRng, sal_uInt16 nPaint = PAINT_ALL );
38 ~ScPaintHint();
40 void SetPrintFlag(sal_Bool bSet) { bPrint = bSet; }
42 const ScRange& GetRange() const { return aRange; }
43 SCCOL GetStartCol() const { return aRange.aStart.Col(); }
44 SCROW GetStartRow() const { return aRange.aStart.Row(); }
45 SCTAB GetStartTab() const { return aRange.aStart.Tab(); }
46 SCCOL GetEndCol() const { return aRange.aEnd.Col(); }
47 SCROW GetEndRow() const { return aRange.aEnd.Row(); }
48 SCTAB GetEndTab() const { return aRange.aEnd.Tab(); }
49 sal_uInt16 GetParts() const { return nParts; }
50 sal_Bool GetPrintFlag() const { return bPrint; }
53 class ScUpdateRefHint : public SfxHint
55 UpdateRefMode eUpdateRefMode;
56 ScRange aRange;
57 SCsCOL nDx;
58 SCsROW nDy;
59 SCsTAB nDz;
61 public:
62 TYPEINFO();
64 ScUpdateRefHint( UpdateRefMode eMode, const ScRange& rR,
65 SCsCOL nX, SCsROW nY, SCsTAB nZ );
66 ~ScUpdateRefHint();
68 UpdateRefMode GetMode() const { return eUpdateRefMode; }
69 const ScRange& GetRange() const { return aRange; }
70 SCsCOL GetDx() const { return nDx; }
71 SCsROW GetDy() const { return nDy; }
72 SCsTAB GetDz() const { return nDz; }
75 #define SC_POINTERCHANGED_NUMFMT 1
77 class ScPointerChangedHint : public SfxHint
79 sal_uInt16 nFlags;
81 public:
82 TYPEINFO();
84 ~ScPointerChangedHint();
86 sal_uInt16 GetFlags() const { return nFlags; }
89 //! move ScLinkRefreshedHint to a different file?
91 #define SC_LINKREFTYPE_NONE 0
92 #define SC_LINKREFTYPE_SHEET 1
93 #define SC_LINKREFTYPE_AREA 2
94 #define SC_LINKREFTYPE_DDE 3
96 class ScLinkRefreshedHint : public SfxHint
98 sal_uInt16 nLinkType; // SC_LINKREFTYPE_...
99 OUString aUrl; // used for sheet links
100 OUString aDdeAppl; // used for dde links:
101 OUString aDdeTopic;
102 OUString aDdeItem;
103 sal_uInt8 nDdeMode;
104 ScAddress aDestPos; // used to identify area links
105 //! also use source data for area links?
107 public:
108 TYPEINFO();
109 ScLinkRefreshedHint();
110 ~ScLinkRefreshedHint();
112 void SetSheetLink( const OUString& rSourceUrl );
113 void SetDdeLink( const OUString& rA, const OUString& rT, const OUString& rI, sal_uInt8 nM );
114 void SetAreaLink( const ScAddress& rPos );
116 sal_uInt16 GetLinkType() const { return nLinkType; }
117 const OUString& GetUrl() const { return aUrl; }
118 const OUString& GetDdeAppl() const { return aDdeAppl; }
119 const OUString& GetDdeTopic() const { return aDdeTopic; }
120 const OUString& GetDdeItem() const { return aDdeItem; }
121 sal_uInt8 GetDdeMode() const { return nDdeMode; }
122 const ScAddress& GetDestPos() const { return aDestPos; }
125 //! move ScAutoStyleHint to a different file?
127 class ScAutoStyleHint : public SfxHint
129 ScRange aRange;
130 OUString aStyle1;
131 OUString aStyle2;
132 sal_uLong nTimeout;
134 public:
135 TYPEINFO();
136 ScAutoStyleHint( const ScRange& rR, const OUString& rSt1,
137 sal_uLong nT, const OUString& rSt2 );
138 ~ScAutoStyleHint();
140 const ScRange& GetRange() const { return aRange; }
141 const OUString& GetStyle1() const { return aStyle1; }
142 sal_uInt32 GetTimeout() const { return nTimeout; }
143 const OUString& GetStyle2() const { return aStyle2; }
146 class ScDBRangeRefreshedHint : public SfxHint
148 ScImportParam aParam;
150 public:
151 TYPEINFO();
152 ScDBRangeRefreshedHint( const ScImportParam& rP );
153 ~ScDBRangeRefreshedHint();
155 const ScImportParam& GetImportParam() const { return aParam; }
158 class ScDataPilotModifiedHint : public SfxHint
160 OUString maName;
162 public:
163 TYPEINFO();
164 ScDataPilotModifiedHint( const OUString& rName );
165 ~ScDataPilotModifiedHint();
167 const OUString& GetName() const { return maName; }
170 #endif
172 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */