Coverage Report

Created: 2026-09-28 10:59

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/sw/source/uibase/inc/navicfg.hxx
Line
Count
Source
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
 * This file is part of the LibreOffice project.
4
 *
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/.
8
 *
9
 * This file incorporates work covered by the following license notice:
10
 *
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 .
18
 */
19
#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_NAVICFG_HXX
20
#define INCLUDED_SW_SOURCE_UIBASE_INC_NAVICFG_HXX
21
22
#include <unotools/configitem.hxx>
23
#include <o3tl/enumarray.hxx>
24
#include "swcont.hxx"
25
26
class SwNavigationConfig final : public utl::ConfigItem
27
{
28
    ContentTypeId  m_nRootType;      //RootType
29
    sal_Int32      m_nSelectedPos;   //SelectedPosition
30
    sal_Int32      m_nOutlineLevel;  //OutlineLevel
31
    sal_Int32      m_nActiveBlock;   //ActiveBlock//Expand/CollapsState
32
    bool           m_bIsSmall;       //ShowListBox
33
    bool           m_bIsGlobalActive; //GlobalDocMode// global view for GlobalDoc valid?
34
    sal_Int32      m_nOutlineTracking;
35
    bool           m_bIsNavigateOnSelect;
36
37
    o3tl::enumarray<ContentTypeId, bool> mContentTypeTrack;
38
39
    sal_Int32 m_nSortAlphabeticallyBlock = 0; // persists content type alphabetical sort setting
40
41
    static css::uno::Sequence<OUString> GetPropertyNames();
42
43
    virtual void ImplCommit() override;
44
45
public:
46
    SwNavigationConfig();
47
    virtual ~SwNavigationConfig() override;
48
49
    void Load();
50
    virtual void Notify( const css::uno::Sequence< OUString >& aPropertyNames ) override;
51
52
0
    ContentTypeId GetRootType()const {return m_nRootType;}
53
0
    void        SetRootType(ContentTypeId nSet){
54
0
                        if(m_nRootType != nSet)
55
0
                        {
56
0
                            SetModified();
57
0
                            m_nRootType = nSet;
58
0
                        }
59
0
                    }
60
61
0
    sal_Int32   GetOutlineLevel()const {return m_nOutlineLevel;}
62
0
    void        SetOutlineLevel(sal_Int32 nSet){
63
0
                        if(m_nOutlineLevel != nSet)
64
0
                        {
65
0
                            SetModified();
66
0
                            m_nOutlineLevel = nSet;
67
0
                        }
68
0
                    }
69
70
0
    sal_Int32   GetActiveBlock()const {return m_nActiveBlock;}
71
0
    void        SetActiveBlock(sal_Int32 nSet){
72
0
                        if(m_nActiveBlock != nSet)
73
0
                        {
74
0
                            SetModified();
75
0
                            m_nActiveBlock = nSet;
76
0
                        }
77
0
                    }
78
79
0
    bool    IsSmall() const {return m_bIsSmall;}
80
0
    void        SetSmall(bool bSet){
81
0
                        if(m_bIsSmall != bSet)
82
0
                        {
83
0
                            SetModified();
84
0
                            m_bIsSmall = bSet;
85
0
                        }
86
0
                    }
87
88
0
    bool    IsGlobalActive() const {return m_bIsGlobalActive;}
89
0
    void        SetGlobalActive(bool bSet){
90
0
                        if(m_bIsGlobalActive != bSet)
91
0
                        {
92
0
                            SetModified();
93
0
                            m_bIsGlobalActive = bSet;
94
0
                        }
95
0
                    }
96
97
0
    sal_Int32   GetOutlineTracking()const {return m_nOutlineTracking;}
98
0
    void        SetOutlineTracking(sal_Int32 nSet){
99
0
                        if(m_nOutlineTracking != nSet)
100
0
                        {
101
0
                            SetModified();
102
0
                            m_nOutlineTracking = nSet;
103
0
                        }
104
0
                    }
105
106
    bool IsContentTypeTrack(ContentTypeId eCntTypeId)
107
0
    {
108
0
        return mContentTypeTrack[eCntTypeId];
109
0
    }
110
    void SetContentTypeTrack(ContentTypeId eCntTypeId, const bool bSet)
111
0
    {
112
0
        if (mContentTypeTrack[eCntTypeId] != bSet)
113
0
        {
114
0
            SetModified();
115
0
            mContentTypeTrack[eCntTypeId] = bSet;
116
0
        }
117
0
    }
118
119
0
    bool    IsNavigateOnSelect() const {return m_bIsNavigateOnSelect;}
120
121
0
    sal_Int32 GetSortAlphabeticallyBlock() const {return m_nSortAlphabeticallyBlock;}
122
    void SetSortAlphabeticallyBlock(sal_Int32 nSet)
123
0
    {
124
0
        if(m_nSortAlphabeticallyBlock != nSet)
125
0
        {
126
0
            SetModified();
127
0
            m_nSortAlphabeticallyBlock = nSet;
128
0
        }
129
0
    }
130
};
131
132
#endif
133
134
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */