LibreOffice Module desktop (master) 1
dp_gui_updatedialog.hxx
Go to the documentation of this file.
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
20#pragma once
21
22#include <sal/config.h>
23
24#include <vector>
25#include <com/sun/star/uno/Reference.hxx>
26#include <com/sun/star/uno/Sequence.hxx>
27#include <rtl/ref.hxx>
28#include <rtl/ustring.hxx>
29#include <tools/link.hxx>
30#include <vcl/weld.hxx>
31
32#include "dp_gui_updatedata.hxx"
33
35
36class Image;
37class KeyEvent;
38class MouseEvent;
39class ResId;
40
41namespace com::sun::star {
42 namespace deployment { class XExtensionManager;
43 class XPackage; }
44 namespace uno { class XComponentContext; }
45}
46
47namespace dp_gui {
52public:
72 css::uno::Reference< css::uno::XComponentContext > const & context,
73 weld::Window * parent,
74 std::vector< css::uno::Reference< css::deployment::XPackage > > && vExtensionList,
75 std::vector< dp_gui::UpdateData > * updateData);
76
77 virtual ~UpdateDialog() override;
78
79 virtual short run() override;
80
81 void notifyMenubar( bool bPrepareOnly, bool bRecheckOnly );
82 static void createNotifyJob( bool bPrepareOnly,
83 css::uno::Sequence< css::uno::Sequence< OUString > > const &rItemList );
84
85private:
86 UpdateDialog(UpdateDialog const &) = delete;
88
89 struct DisabledUpdate;
90 struct SpecificError;
91 struct IgnoredUpdate;
92 struct Index;
93 friend struct Index;
94 class Thread;
95 friend class Thread;
96
97 friend class CheckListBox;
98
99 void insertItem(const UpdateDialog::Index *pIndex, bool bEnableCheckBox);
100 void addAdditional(const UpdateDialog::Index *pIndex, bool bEnableCheckBox);
101 bool isIgnoredUpdate( UpdateDialog::Index *pIndex );
102
103 void addEnabledUpdate( OUString const & name, dp_gui::UpdateData const & data );
106
107 void checkingDone();
108
109 void enableOk();
110
111 void getIgnoredUpdates();
112
113 void initDescription();
114 void clearDescription();
115 bool showDescription(css::uno::Reference<
116 css::deployment::XPackage > const & aExtension);
117 bool showDescription(std::pair< OUString, OUString > const & pairPublisher,
118 OUString const & sReleaseNotes);
119 bool showDescription( css::uno::Reference<
120 css::xml::dom::XNode > const & aUpdateInfo);
121 bool showDescription( const OUString& rDescription);
122
123 DECL_LINK(selectionHandler, weld::TreeView&, void);
124 DECL_LINK(allHandler, weld::Toggleable&, void);
125 DECL_LINK(okHandler, weld::Button&, void);
126 DECL_LINK(closeHandler, weld::Button&, void);
127 DECL_LINK(entryToggled, const weld::TreeView::iter_col&, void);
128
129 css::uno::Reference< css::uno::XComponentContext > m_context;
130 OUString m_none;
132 OUString m_failure;
135 OUString m_noInstall;
139 OUString m_version;
141 std::vector< dp_gui::UpdateData > m_enabledUpdates;
142 std::vector< UpdateDialog::DisabledUpdate > m_disabledUpdates;
143 std::vector< UpdateDialog::SpecificError > m_specificErrors;
144 std::vector< std::unique_ptr<UpdateDialog::IgnoredUpdate> > m_ignoredUpdates;
145 std::vector< std::unique_ptr<Index> > m_ListboxEntries;
146 std::vector< dp_gui::UpdateData > & m_updateData;
148 css::uno::Reference< css::deployment::XExtensionManager > m_xExtensionManager;
149
150 std::unique_ptr<weld::Label> m_xChecking;
151 std::unique_ptr<weld::Spinner> m_xThrobber;
152 std::unique_ptr<weld::Label> m_xUpdate;
153 std::unique_ptr<weld::TreeView> m_xUpdates;
154 std::unique_ptr<weld::CheckButton> m_xAll;
155 std::unique_ptr<weld::Label> m_xDescription;
156 std::unique_ptr<weld::Label> m_xPublisherLabel;
157 std::unique_ptr<weld::LinkButton> m_xPublisherLink;
158 std::unique_ptr<weld::Label> m_xReleaseNotesLabel;
159 std::unique_ptr<weld::LinkButton> m_xReleaseNotesLink;
160 std::unique_ptr<weld::TextView> m_xDescriptions;
161 std::unique_ptr<weld::Button> m_xOk;
162 std::unique_ptr<weld::Button> m_xClose;
163 std::unique_ptr<weld::Button> m_xHelp;
164};
165
166}
167
168/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
The modal “Check for Updates” dialog.
DECL_LINK(closeHandler, weld::Button &, void)
void addAdditional(const UpdateDialog::Index *pIndex, bool bEnableCheckBox)
void notifyMenubar(bool bPrepareOnly, bool bRecheckOnly)
static void createNotifyJob(bool bPrepareOnly, css::uno::Sequence< css::uno::Sequence< OUString > > const &rItemList)
std::unique_ptr< weld::TextView > m_xDescriptions
virtual ~UpdateDialog() override
bool showDescription(css::uno::Reference< css::deployment::XPackage > const &aExtension)
std::unique_ptr< weld::Label > m_xChecking
css::uno::Reference< css::uno::XComponentContext > m_context
DECL_LINK(selectionHandler, weld::TreeView &, void)
DECL_LINK(allHandler, weld::Toggleable &, void)
std::unique_ptr< weld::Label > m_xPublisherLabel
UpdateDialog(UpdateDialog const &)=delete
std::vector< UpdateDialog::SpecificError > m_specificErrors
std::unique_ptr< weld::TreeView > m_xUpdates
std::unique_ptr< weld::Button > m_xOk
std::unique_ptr< weld::CheckButton > m_xAll
DECL_LINK(okHandler, weld::Button &, void)
void addDisabledUpdate(UpdateDialog::DisabledUpdate const &data)
std::unique_ptr< weld::Button > m_xClose
void addSpecificError(UpdateDialog::SpecificError const &data)
virtual short run() override
DECL_LINK(entryToggled, const weld::TreeView::iter_col &, void)
UpdateDialog & operator=(UpdateDialog const &)=delete
std::unique_ptr< weld::Spinner > m_xThrobber
void insertItem(const UpdateDialog::Index *pIndex, bool bEnableCheckBox)
css::uno::Reference< css::deployment::XExtensionManager > m_xExtensionManager
std::unique_ptr< weld::LinkButton > m_xReleaseNotesLink
std::vector< UpdateDialog::DisabledUpdate > m_disabledUpdates
std::unique_ptr< weld::Label > m_xUpdate
std::vector< std::unique_ptr< Index > > m_ListboxEntries
std::unique_ptr< weld::Button > m_xHelp
std::unique_ptr< weld::LinkButton > m_xPublisherLink
std::vector< dp_gui::UpdateData > & m_updateData
std::unique_ptr< weld::Label > m_xDescription
bool showDescription(css::uno::Reference< css::xml::dom::XNode > const &aUpdateInfo)
std::vector< dp_gui::UpdateData > m_enabledUpdates
void addEnabledUpdate(OUString const &name, dp_gui::UpdateData const &data)
rtl::Reference< UpdateDialog::Thread > m_thread
std::unique_ptr< weld::Label > m_xReleaseNotesLabel
std::vector< std::unique_ptr< UpdateDialog::IgnoredUpdate > > m_ignoredUpdates
UpdateDialog(css::uno::Reference< css::uno::XComponentContext > const &context, weld::Window *parent, std::vector< css::uno::Reference< css::deployment::XPackage > > &&vExtensionList, std::vector< dp_gui::UpdateData > *updateData)
Create an instance.
bool isIgnoredUpdate(UpdateDialog::Index *pIndex)
std::pair< const TreeIter &, int > iter_col
Definition: dp_gui.h:22