Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / inc / reftokenhelper.hxx
blobcd1c9e8112e85e312d8c4c2065bf4cce05f78ac1
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_REFTOKENHELPER_HXX
21 #define SC_REFTOKENHELPER_HXX
23 #include "token.hxx"
25 #include <vector>
28 class ScDocument;
29 class ScRange;
30 class ScRangeList;
32 class ScRefTokenHelper
34 private:
35 ScRefTokenHelper();
36 ScRefTokenHelper(const ScRefTokenHelper&);
37 ~ScRefTokenHelper();
39 public:
40 /**
41 * Compile an array of reference tokens from a data source range string.
42 * The source range may consist of multiple ranges separated by ';'s.
44 static void compileRangeRepresentation(
45 ::std::vector<ScTokenRef>& rRefTokens, const OUString& rRangeStr, ScDocument* pDoc,
46 const sal_Unicode cSep, ::formula::FormulaGrammar::Grammar eGrammar, bool bOnly3DRef = false);
48 static bool getRangeFromToken(ScRange& rRange, const ScTokenRef& pToken, const ScAddress& rPos, bool bExternal = false);
50 static void getRangeListFromTokens(ScRangeList& rRangeList, const ::std::vector<ScTokenRef>& pTokens, const ScAddress& rPos);
52 /**
53 * Create a double reference token from a range object.
55 static void getTokenFromRange(ScTokenRef& pToken, const ScRange& rRange);
57 static void getTokensFromRangeList(::std::vector<ScTokenRef>& pTokens, const ScRangeList& rRanges);
59 static bool SC_DLLPUBLIC isRef(const ScTokenRef& pToken);
60 static bool SC_DLLPUBLIC isExternalRef(const ScTokenRef& pToken);
62 static bool SC_DLLPUBLIC intersects(
63 const ::std::vector<ScTokenRef>& rTokens, const ScTokenRef& pToken, const ScAddress& rPos);
65 static void SC_DLLPUBLIC join(::std::vector<ScTokenRef>& rTokens, const ScTokenRef& pToken, const ScAddress& rPos);
67 static bool getDoubleRefDataFromToken(ScComplexRefData& rData, const ScTokenRef& pToken);
69 static ScTokenRef createRefToken(const ScAddress& rAddr);
70 static ScTokenRef createRefToken(const ScRange& rRange);
73 #endif
75 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */