LibreOffice Module cui (master) 1
cuigaldlg.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 <salhelper/thread.hxx>
25#include <tools/urlobj.hxx>
26#include <vcl/idle.hxx>
27#include <sfx2/tabdlg.hxx>
28#include <svx/galctrl.hxx>
29#include <svx/galmisc.hxx>
30#include <com/sun/star/media/XPlayer.hpp>
31#include <com/sun/star/ui/dialogs/XFolderPicker2.hpp>
33
34#include <string_view>
35#include <vector>
36
37class GalleryTheme;
38class SearchProgress;
39class TakeProgress;
41
42typedef std::vector< sal_Int32 > TokenList_impl;
43
44struct FilterEntry
45{
46 OUString aFilterName;
47};
48
50{
51private:
52
56
57 void ImplSearch( const INetURLObject& rStartURL,
58 const std::vector< OUString >& rFormats,
59 bool bRecursive );
60
61 virtual ~SearchThread() override;
62 virtual void execute() override;
63
64public:
65
68 INetURLObject aStartURL);
69};
70
72{
73private:
77 std::unique_ptr<weld::Label> m_xFtSearchDir;
78 std::unique_ptr<weld::Label> m_xFtSearchType;
79 std::unique_ptr<weld::Button> m_xBtnCancel;
80
81 DECL_LINK(ClickCancelBtn, weld::Button&, void);
82
83public:
85 void LaunchThread();
86 virtual ~SearchProgress() override;
87
88 DECL_LINK( CleanUpHdl, void*, void );
89
90 void SetFileType( const OUString& rType ) { m_xFtSearchType->set_label(rType); }
91 void SetDirectory( const INetURLObject& rURL ) { m_xFtSearchDir->set_label(GetReducedString(rURL, 30)); }
92};
93
95{
96private:
97
101
102 virtual ~TakeThread() override;
103 virtual void execute() override;
104
105public:
106
108 TakeProgress* pProgress,
109 TPGalleryThemeProperties* pBrowser,
110 TokenList_impl& rTakenList
111 );
112};
113
115{
116private:
121 std::unique_ptr<weld::Label> m_xFtTakeFile;
122 std::unique_ptr<weld::Button> m_xBtnCancel;
123
124 DECL_LINK(ClickCancelBtn, weld::Button&, void);
125
126public:
127
129 void LaunchThread();
130 virtual ~TakeProgress() override;
131
132 DECL_LINK( CleanUpHdl, void*, void );
133
134 void SetFile( const INetURLObject& rURL ) { m_xFtTakeFile->set_label(GetReducedString(rURL, 30)); }
135};
136
138{
139private:
143 std::unique_ptr<weld::Label> m_xFtActualizeFile;
144 std::unique_ptr<weld::Button> m_xBtnCancel;
145
146 DECL_LINK(ClickCancelBtn, weld::Button&, void);
147 DECL_LINK(TimeoutHdl, Timer*, void);
148 DECL_LINK(ActualizeHdl, const INetURLObject&, void);
149
150public:
152 virtual ~ActualizeProgress() override;
153
154 virtual short run() override;
155};
156
158{
159private:
160 std::unique_ptr<weld::Entry> m_xEdit;
161public:
162 TitleDialog(weld::Widget* pParent, const OUString& rOldText);
163 virtual ~TitleDialog() override;
164 OUString GetTitle() const { return m_xEdit->get_text(); }
165};
166
168{
169private:
171 std::unique_ptr<weld::Button> m_xBtnOk;
172 std::unique_ptr<weld::ComboBox> m_xLbResName;
173
174 DECL_LINK(ClickOkHdl, weld::Button&, void);
175public:
177 virtual ~GalleryIdDialog() override;
178 sal_uInt32 GetId() const { return m_xLbResName->get_active(); }
179};
180
182{
184
185 virtual void PageCreated(const OUString& rId, SfxTabPage &rPage) override;
186
187public:
189};
190
192{
193private:
195
196 std::unique_ptr<weld::Image> m_xFiMSImage;
197 std::unique_ptr<weld::Entry> m_xEdtMSName;
198 std::unique_ptr<weld::Label> m_xFtMSShowType;
199 std::unique_ptr<weld::Label> m_xFtMSShowPath;
200 std::unique_ptr<weld::Label> m_xFtMSShowContent;
201 std::unique_ptr<weld::Label> m_xFtMSShowChangeDate;
202
203 virtual void Reset( const SfxItemSet* ) override {}
204 virtual bool FillItemSet( SfxItemSet* rSet ) override;
205
206public:
209 static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet );
210};
211
213{
214 friend class SearchThread;
215 friend class TakeProgress;
216 friend class TakeThread;
217
219 std::vector<OUString> aFoundList;
220 std::vector< std::unique_ptr<FilterEntry> >
230
232 css::uno::Reference< css::media::XPlayer > xMediaPlayer;
233 css::uno::Reference< css::ui::dialogs::XFolderPicker2 > xFolderPicker;
234
236 std::unique_ptr<weld::ComboBox> m_xCbbFileType;
237 std::unique_ptr<weld::TreeView> m_xLbxFound;
238 std::unique_ptr<weld::Button> m_xBtnSearch;
239 std::unique_ptr<weld::Button> m_xBtnTake;
240 std::unique_ptr<weld::Button> m_xBtnTakeAll;
241 std::unique_ptr<weld::CheckButton> m_xCbxPreview;
242 std::unique_ptr<weld::CustomWeld> m_xWndPreview;
243
244 virtual void Reset( const SfxItemSet* /*rSet*/ ) override {}
245 virtual bool FillItemSet( SfxItemSet* /*rSet*/ ) override { return true; }
246 static OUString addExtension( const OUString&, std::u16string_view );
247 void FillFilterList();
248
249 void SearchFiles();
250 void TakeFiles();
251 void DoPreview();
252 void EndSearchProgressHdl(sal_Int32 nResult);
253
254 DECL_LINK(ClickPreviewHdl, weld::Toggleable&, void);
255 DECL_LINK(ClickSearchHdl, weld::Button&, void);
256 DECL_LINK(ClickTakeHdl, weld::Button&, void);
257 DECL_LINK(ClickTakeAllHdl, weld::Button&, void);
258 DECL_LINK(SelectFoundHdl, weld::TreeView&, void);
259 DECL_LINK(SelectFileTypeHdl, weld::ComboBox&, void);
260 DECL_LINK(DClickFoundHdl, weld::TreeView&, bool);
261 DECL_LINK(PreviewTimerHdl, Timer*, void);
262 DECL_LINK(DialogClosedHdl, css::ui::dialogs::DialogClosedEvent*, void);
263
264public:
266 virtual ~TPGalleryThemeProperties() override;
267
269 const ExchangeData* GetXChgData() const { return pData; }
270
271 void StartSearchFiles( std::u16string_view _rFolderURL, short _nDlgResult );
272
273 static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet);
274};
275
276/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
DECL_LINK(ActualizeHdl, const INetURLObject &, void)
virtual short run() override
Definition: cuigaldlg.cxx:382
virtual ~ActualizeProgress() override
Definition: cuigaldlg.cxx:378
DECL_LINK(TimeoutHdl, Timer *, void)
std::unique_ptr< weld::Button > m_xBtnCancel
Definition: cuigaldlg.hxx:144
DECL_LINK(ClickCancelBtn, weld::Button &, void)
ActualizeProgress(weld::Widget *pWindow, GalleryTheme *pThm)
Definition: cuigaldlg.cxx:367
GalleryTheme * pTheme
Definition: cuigaldlg.hxx:141
GalleryProgress aStatusProgress
Definition: cuigaldlg.hxx:142
std::unique_ptr< weld::Label > m_xFtActualizeFile
Definition: cuigaldlg.hxx:143
sal_uInt32 GetId() const
Definition: cuigaldlg.hxx:178
virtual ~GalleryIdDialog() override
Definition: cuigaldlg.cxx:444
std::unique_ptr< weld::ComboBox > m_xLbResName
Definition: cuigaldlg.hxx:172
DECL_LINK(ClickOkHdl, weld::Button &, void)
std::unique_ptr< weld::Button > m_xBtnOk
Definition: cuigaldlg.hxx:171
GalleryIdDialog(weld::Widget *pParent, GalleryTheme *pThm)
Definition: cuigaldlg.cxx:428
GalleryTheme * m_pThm
Definition: cuigaldlg.hxx:170
ExchangeData * pData
Definition: cuigaldlg.hxx:183
GalleryThemeProperties(weld::Widget *pParent, ExchangeData *pData, SfxItemSet const *pItemSet)
Definition: cuigaldlg.cxx:476
virtual void PageCreated(const OUString &rId, SfxTabPage &rPage) override
Definition: cuigaldlg.cxx:495
std::unique_ptr< weld::Label > m_xFtSearchDir
Definition: cuigaldlg.hxx:77
SearchProgress(weld::Window *pParent, TPGalleryThemeProperties *pTabPage, INetURLObject aStartURL)
Definition: cuigaldlg.cxx:192
DECL_LINK(CleanUpHdl, void *, void)
void SetDirectory(const INetURLObject &rURL)
Definition: cuigaldlg.hxx:91
std::unique_ptr< weld::Label > m_xFtSearchType
Definition: cuigaldlg.hxx:78
std::unique_ptr< weld::Button > m_xBtnCancel
Definition: cuigaldlg.hxx:79
TPGalleryThemeProperties * m_pTabPage
Definition: cuigaldlg.hxx:75
DECL_LINK(ClickCancelBtn, weld::Button &, void)
INetURLObject startUrl_
Definition: cuigaldlg.hxx:74
void LaunchThread()
Definition: cuigaldlg.cxx:222
rtl::Reference< SearchThread > m_aSearchThread
Definition: cuigaldlg.hxx:76
virtual ~SearchProgress() override
Definition: cuigaldlg.cxx:204
void SetFileType(const OUString &rType)
Definition: cuigaldlg.hxx:90
TPGalleryThemeProperties * mpBrowser
Definition: cuigaldlg.hxx:54
SearchProgress * mpProgress
Definition: cuigaldlg.hxx:53
void ImplSearch(const INetURLObject &rStartURL, const std::vector< OUString > &rFormats, bool bRecursive)
Definition: cuigaldlg.cxx:109
virtual ~SearchThread() override
Definition: cuigaldlg.cxx:77
SearchThread(SearchProgress *pProgress, TPGalleryThemeProperties *pBrowser, INetURLObject aStartURL)
Definition: cuigaldlg.cxx:67
INetURLObject maStartURL
Definition: cuigaldlg.hxx:55
virtual void execute() override
Definition: cuigaldlg.cxx:81
virtual void Reset(const SfxItemSet *) override
Definition: cuigaldlg.hxx:203
ExchangeData * pData
Definition: cuigaldlg.hxx:194
std::unique_ptr< weld::Image > m_xFiMSImage
Definition: cuigaldlg.hxx:196
std::unique_ptr< weld::Label > m_xFtMSShowChangeDate
Definition: cuigaldlg.hxx:201
std::unique_ptr< weld::Label > m_xFtMSShowPath
Definition: cuigaldlg.hxx:199
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: cuigaldlg.cxx:567
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Definition: cuigaldlg.cxx:573
std::unique_ptr< weld::Entry > m_xEdtMSName
Definition: cuigaldlg.hxx:197
TPGalleryThemeGeneral(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: cuigaldlg.cxx:503
void SetXChgData(ExchangeData *pData)
Definition: cuigaldlg.cxx:515
std::unique_ptr< weld::Label > m_xFtMSShowContent
Definition: cuigaldlg.hxx:200
std::unique_ptr< weld::Label > m_xFtMSShowType
Definition: cuigaldlg.hxx:198
virtual bool FillItemSet(SfxItemSet *) override
Definition: cuigaldlg.hxx:245
css::uno::Reference< css::ui::dialogs::XFolderPicker2 > xFolderPicker
Definition: cuigaldlg.hxx:233
DECL_LINK(ClickTakeHdl, weld::Button &, void)
virtual ~TPGalleryThemeProperties() override
Definition: cuigaldlg.cxx:634
void SetXChgData(ExchangeData *pData)
Definition: cuigaldlg.cxx:601
DECL_LINK(SelectFoundHdl, weld::TreeView &, void)
void StartSearchFiles(std::u16string_view _rFolderURL, short _nDlgResult)
Definition: cuigaldlg.cxx:624
ExchangeData * pData
Definition: cuigaldlg.hxx:218
std::unique_ptr< weld::Button > m_xBtnTake
Definition: cuigaldlg.hxx:239
void EndSearchProgressHdl(sal_Int32 nResult)
Definition: cuigaldlg.cxx:983
static OUString addExtension(const OUString &, std::u16string_view)
Definition: cuigaldlg.cxx:646
DECL_LINK(ClickSearchHdl, weld::Button &, void)
std::unique_ptr< weld::CustomWeld > m_xWndPreview
Definition: cuigaldlg.hxx:242
std::unique_ptr< weld::TreeView > m_xLbxFound
Definition: cuigaldlg.hxx:237
std::unique_ptr< weld::CheckButton > m_xCbxPreview
Definition: cuigaldlg.hxx:241
virtual void Reset(const SfxItemSet *) override
Definition: cuigaldlg.hxx:244
DialogGalleryPreview m_aWndPreview
Definition: cuigaldlg.hxx:235
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Definition: cuigaldlg.cxx:641
std::vector< OUString > aFoundList
Definition: cuigaldlg.hxx:219
TPGalleryThemeProperties(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: cuigaldlg.cxx:578
DECL_LINK(SelectFileTypeHdl, weld::ComboBox &, void)
DECL_LINK(PreviewTimerHdl, Timer *, void)
const ExchangeData * GetXChgData() const
Definition: cuigaldlg.hxx:269
std::unique_ptr< weld::Button > m_xBtnTakeAll
Definition: cuigaldlg.hxx:240
css::uno::Reference< css::media::XPlayer > xMediaPlayer
Definition: cuigaldlg.hxx:232
std::unique_ptr< weld::Button > m_xBtnSearch
Definition: cuigaldlg.hxx:238
DECL_LINK(ClickPreviewHdl, weld::Toggleable &, void)
DECL_LINK(DialogClosedHdl, css::ui::dialogs::DialogClosedEvent *, void)
std::unique_ptr< weld::ComboBox > m_xCbbFileType
Definition: cuigaldlg.hxx:236
rtl::Reference< ::svt::DialogClosedListener > xDialogListener
Definition: cuigaldlg.hxx:231
DECL_LINK(ClickTakeAllHdl, weld::Button &, void)
DECL_LINK(DClickFoundHdl, weld::TreeView &, bool)
std::vector< std::unique_ptr< FilterEntry > > aFilterEntryList
Definition: cuigaldlg.hxx:221
DECL_LINK(CleanUpHdl, void *, void)
std::unique_ptr< weld::Button > m_xBtnCancel
Definition: cuigaldlg.hxx:122
void SetFile(const INetURLObject &rURL)
Definition: cuigaldlg.hxx:134
TPGalleryThemeProperties * m_pTabPage
Definition: cuigaldlg.hxx:118
void LaunchThread()
Definition: cuigaldlg.cxx:360
std::unique_ptr< weld::Label > m_xFtTakeFile
Definition: cuigaldlg.hxx:121
TakeProgress(weld::Window *pParent, TPGalleryThemeProperties *pTabPage)
Definition: cuigaldlg.cxx:293
rtl::Reference< TakeThread > maTakeThread
Definition: cuigaldlg.hxx:119
virtual ~TakeProgress() override
Definition: cuigaldlg.cxx:304
weld::Window * m_pParent
Definition: cuigaldlg.hxx:117
TokenList_impl maTakenList
Definition: cuigaldlg.hxx:120
DECL_LINK(ClickCancelBtn, weld::Button &, void)
TPGalleryThemeProperties * mpBrowser
Definition: cuigaldlg.hxx:99
TakeThread(TakeProgress *pProgress, TPGalleryThemeProperties *pBrowser, TokenList_impl &rTakenList)
Definition: cuigaldlg.cxx:229
virtual void execute() override
Definition: cuigaldlg.cxx:246
TakeProgress * mpProgress
Definition: cuigaldlg.hxx:98
virtual ~TakeThread() override
Definition: cuigaldlg.cxx:242
TokenList_impl & mrTakenList
Definition: cuigaldlg.hxx:100
virtual ~TitleDialog() override
Definition: cuigaldlg.cxx:424
std::unique_ptr< weld::Entry > m_xEdit
Definition: cuigaldlg.hxx:160
OUString GetTitle() const
Definition: cuigaldlg.hxx:164
TitleDialog(weld::Widget *pParent, const OUString &rOldText)
Definition: cuigaldlg.cxx:416
std::vector< sal_Int32 > TokenList_impl
Definition: cuigaldlg.hxx:40
SVXCORE_DLLPUBLIC OUString GetReducedString(const INetURLObject &rURL, sal_Int32 nMaxLen)