summaryrefslogtreecommitdiff
path: root/cui/source/options/optaboutconfig.hxx
blob: 460e5e928de1482906b6a120f57e0aaf53af5956 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

#ifndef INCLUDED_CUI_SOURCE_OPTIONS_OPTABOUTCONFIG_HXX
#define INCLUDED_CUI_SOURCE_OPTIONS_OPTABOUTCONFIG_HXX

#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/util/SearchOptions2.hpp>

#include <sfx2/tabdlg.hxx>
#include <svtools/simptabl.hxx>
#include <vcl/edit.hxx>

#include <vector>

namespace svx { class OptHeaderTabListBox; }
class CuiAboutConfigTabPage;
class CuiAboutConfigValueDialog;
struct Prop_Impl;

class CuiCustomMultilineEdit : public Edit
{
public:
    bool bNumericOnly;
    CuiCustomMultilineEdit( vcl::Window* pParent, WinBits nStyle )
        : Edit( pParent, nStyle )
        , bNumericOnly(false)
    {}

    virtual void KeyInput( const KeyEvent& rKeyEvent ) override;
    virtual Size GetOptimalSize() const override;
};

class CuiAboutConfigTabPage : public ModelessDialog
{
private:
    VclPtr<SvSimpleTableContainer> m_pPrefCtrl;
    VclPtr<PushButton> m_pResetBtn;
    VclPtr<PushButton> m_pEditBtn;
    VclPtr<PushButton> m_pSearchBtn;
    VclPtr<Edit> m_pSearchEdit;

    SvTreeListEntries m_modifiedPrefBoxEntries;
    std::vector< std::shared_ptr< Prop_Impl > > m_vectorOfModified;
    VclPtr< SvSimpleTable > m_pPrefBox;

     //for search
    css::util::SearchOptions2 m_options;
    SvTreeListEntries m_prefBoxEntries;

    void AddToModifiedVector( const std::shared_ptr< Prop_Impl >& rProp );
    static std::vector< OUString > commaStringToSequence( const OUString& rCommaSepString );
    void InsertEntry( SvTreeListEntry *pEntry);

    DECL_LINK_TYPED( StandardHdl_Impl, Button*, void );
    DECL_LINK_TYPED( DoubleClickHdl_Impl, SvTreeListBox*, bool );
    DECL_LINK_TYPED( ResetBtnHdl_Impl, Button*, void );
    DECL_LINK_TYPED( SearchHdl_Impl, Button*, void );
    DECL_LINK_TYPED( ExpandingHdl_Impl, SvTreeListBox*, bool );

public:
   explicit CuiAboutConfigTabPage(vcl::Window* pParent);
   virtual ~CuiAboutConfigTabPage();
   virtual void dispose() override;
   void     InsertEntry(const OUString &rPropertyPath, const OUString& rProp, const OUString& rStatus, const OUString& rType, const OUString& rValue,
                        SvTreeListEntry *pParentEntry, bool bInsertToPrefBox);
   void     Reset();
   void     FillItems(const css::uno::Reference<css::container::XNameAccess>& xNameAccess,
                      SvTreeListEntry *pParentEntry = nullptr, int lineage = 0, bool bLoadAll = false);
   static css::uno::Reference< css::container::XNameAccess > getConfigAccess( const OUString& sNodePath, bool bUpdate );
   void FillItemSet();
};

class CuiAboutConfigValueDialog : public ModalDialog
{
private:
    VclPtr<CuiCustomMultilineEdit> m_pEDValue;

public:
    CuiAboutConfigValueDialog( vcl::Window* pWindow, const OUString& rValue , int limit = 0);
    virtual ~CuiAboutConfigValueDialog();
    virtual void dispose() override;

    OUString getValue()
    {
        return m_pEDValue->GetText();
    }
};

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */