Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / sc / source / ui / inc / selectionstate.hxx
blob86a8d6f6a1805eb3b00190a685c49a50e95ba7ba
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 INCLUDED_SC_SOURCE_UI_INC_SELECTIONSTATE_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_SELECTIONSTATE_HXX
23 #include <editeng/editdata.hxx>
24 #include "rangelst.hxx"
26 /** Enumerates all possible types of selections in a Calc document. */
27 enum ScSelectionType
29 SC_SELECTTYPE_NONE, /// No selection, simple cell cursor.
30 SC_SELECTTYPE_SHEET, /// Single cell, cell range, or multi range selection.
31 SC_SELECTTYPE_EDITCELL, /// Cell in edit mode (with or without selection).
32 SC_SELECTTYPE_DRAWING, /// One or more drawing objects.
33 SC_SELECTTYPE_EDITDRAW /// Edit mode in drawing object (with or without selection).
36 class ScViewData;
38 /** Contains all available data about any possible selection in a Calc document. */
39 class ScSelectionState
41 public:
42 explicit ScSelectionState( ScViewData& rViewData );
44 /** Returns the type of the selection this object contains. */
45 inline ScSelectionType GetSelectionType() const { return meType; }
47 /** Returns the position of the cell cursor. */
48 inline const ScAddress& GetCellCursor() const { return maCursor; }
49 /** Returns the edit engine selection. */
50 inline const ESelection& GetEditSelection() const { return maEditSel; }
52 private:
53 ScSelectionType meType; /// Type of the selection.
54 ScAddress maCursor; /// Cell cursor position.
55 ScRangeList maSheetSel; /// Sheet selection.
56 ESelection maEditSel; /// Selection in edit mode.
59 #endif
61 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */