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