2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 #ifndef _SVX_SIDEBAR_SELECTION_ANALYZER_HXX_
19 #define _SVX_SIDEBAR_SELECTION_ANALYZER_HXX_
21 #include <sfx2/sidebar/EnumContext.hxx>
22 #include "svx/svxdllapi.h"
28 namespace svx
{ namespace sidebar
{
30 /** Analyze the current selection of Calc or Draw/Impress documents
31 and return the associated sidebar context.
33 The decision is based on heuristics. Do not expect pretty code.
35 class SVX_DLLPUBLIC SelectionAnalyzer
38 static sfx2::sidebar::EnumContext::Context
GetContextForSelection_SC (
39 const SdrMarkList
& rMarkList
);
49 static sfx2::sidebar::EnumContext::Context
GetContextForSelection_SD (
50 const SdrMarkList
& rMarkList
,
51 const ViewType eViewType
);
54 static sfx2::sidebar::EnumContext::Context
GetContextForObjectId_SC (
55 const sal_uInt16 nObjectId
);
56 static sfx2::sidebar::EnumContext::Context
GetContextForObjectId_SD (
57 const sal_uInt16 nObjectId
,
58 const ViewType eViewType
);
59 static sal_uInt32
GetInventorTypeFromMark (
60 const SdrMarkList
& rMarkList
);
61 static sal_uInt16
GetObjectTypeFromMark (
62 const SdrMarkList
& rMarkList
);
63 static sal_uInt16
GetObjectTypeFromGroup (
64 const SdrObject
* pObj
);
65 static bool IsShapeType (
66 const sal_uInt16 nType
);
67 static bool IsTextObjType (
68 const sal_uInt16 nType
);
71 } } // end of namespace svx::sidebar