21#include <osl/file.hxx>
23#include <rtl/ustring.hxx>
33#include <sfx2/sfxsids.hrc>
35#include <officecfg/Inet.hxx>
36#include <officecfg/Office/Common.hxx>
37#include <officecfg/Office/Recovery.hxx>
63 std::unique_ptr<Idle> pIdle;
68 explicit SfxEventAsyncer_Impl(
const SfxEventHint& rHint);
76 if( rHint.
GetId() == SfxHintId::Dying && pIdle->IsActive() )
84SfxEventAsyncer_Impl::SfxEventAsyncer_Impl(
const SfxEventHint& rHint )
89 pIdle.reset(
new Idle(
"sfx::SfxEventAsyncer_Impl pIdle") );
90 pIdle->SetInvokeHandler(
LINK(
this, SfxEventAsyncer_Impl, IdleHdl) );
91 pIdle->SetPriority( TaskPriority::HIGH_IDLE );
100 SAL_INFO_IF(!xRef.
is(),
"sfx.appl",
"SfxEvent: " << aHint.GetEventName());
103 xRef->Broadcast( aHint );
111 return rSet.
Put(Item(wid, Cfg::get()));
113template <
class Cfg,
class Item,
class Val>
116 return rSet.
Put(Item(wid, Cfg::get().value_or(std::move(defVal))));
120 return Cfg::isReadOnly() || toSet<Cfg>(
rSet, wid);
123template <
class Cfg,
class Item>
125 std::shared_ptr<comphelper::ConfigurationChanges>
const& batch)
128 Cfg::set(pItem->GetValue(), batch);
140 case SID_ATTR_BACKUP:
142 if (!officecfg::Office::Common::Save::Document::CreateBackup::isReadOnly())
147 case SID_ATTR_BACKUP_BESIDE_ORIGINAL:
148 bRet = toSet_ifRW<officecfg::Office::Common::Save::Document::BackupIntoDocumentFolder>(
149 rSet, SID_ATTR_BACKUP_BESIDE_ORIGINAL);
151 case SID_ATTR_PRETTYPRINTING:
152 bRet = toSet_ifRW<officecfg::Office::Common::Save::Document::PrettyPrinting>(
153 rSet, SID_ATTR_PRETTYPRINTING);
155 case SID_ATTR_WARNALIENFORMAT:
156 bRet = toSet_ifRW<officecfg::Office::Common::Save::Document::WarnAlienFormat>(
157 rSet, SID_ATTR_WARNALIENFORMAT);
159 case SID_ATTR_AUTOSAVE:
160 bRet = toSet_ifRW<officecfg::Office::Recovery::AutoSave::Enabled>(
161 rSet, SID_ATTR_AUTOSAVE);
163 case SID_ATTR_AUTOSAVEMINUTE:
164 bRet = toSet_ifRW<officecfg::Office::Recovery::AutoSave::TimeIntervall>(
165 rSet, SID_ATTR_AUTOSAVEMINUTE);
167 case SID_ATTR_USERAUTOSAVE:
168 bRet = toSet_ifRW<officecfg::Office::Recovery::AutoSave::UserAutoSaveEnabled>(
169 rSet, SID_ATTR_USERAUTOSAVE);
171 case SID_ATTR_DOCINFO:
172 bRet = toSet_ifRW<officecfg::Office::Common::Save::Document::EditProperty>(
173 rSet, SID_ATTR_DOCINFO);
175 case SID_ATTR_QUICKLAUNCHER:
188 case SID_SAVEREL_INET:
189 bRet = toSet_ifRW<officecfg::Office::Common::Save::URL::Internet>(
190 rSet, SID_SAVEREL_INET);
192 case SID_SAVEREL_FSYS:
193 bRet = toSet_ifRW<officecfg::Office::Common::Save::URL::FileSystem>(
194 rSet, SID_SAVEREL_FSYS);
206 case SID_INET_HTTP_PROXY_NAME:
207 bRet = toSet<officecfg::Inet::Settings::ooInetHTTPProxyName>(
208 rSet, SID_INET_HTTP_PROXY_NAME);
210 case SID_INET_HTTP_PROXY_PORT:
211 bRet = toSet_withDefault<officecfg::Inet::Settings::ooInetHTTPProxyPort>(
212 rSet, SID_INET_HTTP_PROXY_PORT, 0);
214 case SID_INET_FTP_PROXY_NAME:
215 bRet = toSet<officecfg::Inet::Settings::ooInetFTPProxyName>(
216 rSet, SID_INET_FTP_PROXY_NAME);
218 case SID_INET_FTP_PROXY_PORT:
219 bRet = toSet_withDefault<officecfg::Inet::Settings::ooInetFTPProxyPort>(
220 rSet, SID_INET_FTP_PROXY_PORT, 0);
222 case SID_INET_NOPROXY:
223 bRet = toSet<officecfg::Inet::Settings::ooInetNoProxy>(
rSet, SID_INET_NOPROXY);
227 SAL_INFO(
"sfx.appl",
"W1:Wrong ID while getting Options!" );
230 SAL_WARN_IF(!bRet,
"sfx.appl",
"Putting options failed!");
236 std::shared_ptr< comphelper::ConfigurationChanges > batch(
240 toCfg_ifSet<officecfg::Office::Common::Save::Document::CreateBackup>(
241 rSet, SID_ATTR_BACKUP, batch);
243 toCfg_ifSet<officecfg::Office::Common::Save::Document::BackupIntoDocumentFolder>(
244 rSet, SID_ATTR_BACKUP_BESIDE_ORIGINAL, batch);
247 toCfg_ifSet<officecfg::Office::Common::Save::Document::PrettyPrinting>(
248 rSet, SID_ATTR_PRETTYPRINTING, batch);
251 toCfg_ifSet<officecfg::Office::Common::Save::Document::WarnAlienFormat>(
252 rSet, SID_ATTR_WARNALIENFORMAT, batch);
255 toCfg_ifSet<officecfg::Office::Recovery::AutoSave::Enabled>(
rSet, SID_ATTR_AUTOSAVE, batch);
258 toCfg_ifSet<officecfg::Office::Recovery::AutoSave::TimeIntervall>(
259 rSet, SID_ATTR_AUTOSAVEMINUTE, batch);
262 toCfg_ifSet<officecfg::Office::Recovery::AutoSave::UserAutoSaveEnabled>(
263 rSet, SID_ATTR_USERAUTOSAVE, batch);
266 toCfg_ifSet<officecfg::Office::Common::Save::Document::EditProperty>(
267 rSet, SID_ATTR_DOCINFO, batch);
270 toCfg_ifSet<officecfg::Office::Common::Help::ExtendedTip>(
rSet, SID_HELPBALLOONS, batch);
273 toCfg_ifSet<officecfg::Office::Common::Help::Tip>(
rSet, SID_HELPTIPS, batch);
276 toCfg_ifSet<officecfg::Office::Common::Save::URL::Internet>(
rSet, SID_SAVEREL_INET, batch);
279 toCfg_ifSet<officecfg::Office::Common::Save::URL::FileSystem>(
rSet, SID_SAVEREL_FSYS, batch);
284 sal_uInt16 nUndoCount = pItem->GetValue();
285 officecfg::Office::Common::Undo::Steps::set(nUndoCount, batch);
300 ++nIdx, pSh = pDispat->
GetShell(nIdx) )
315 toCfg_ifSet<officecfg::Inet::Settings::ooInetProxyType>(
rSet, SID_INET_PROXY_TYPE, batch);
317 toCfg_ifSet<officecfg::Inet::Settings::ooInetHTTPProxyName>(
318 rSet, SID_INET_HTTP_PROXY_NAME, batch);
319 toCfg_ifSet<officecfg::Inet::Settings::ooInetHTTPProxyPort>(
320 rSet, SID_INET_HTTP_PROXY_PORT, batch);
321 toCfg_ifSet<officecfg::Inet::Settings::ooInetFTPProxyName>(
322 rSet, SID_INET_FTP_PROXY_NAME, batch);
323 toCfg_ifSet<officecfg::Inet::Settings::ooInetFTPProxyPort>(
324 rSet, SID_INET_FTP_PROXY_PORT, batch);
325 toCfg_ifSet<officecfg::Inet::Settings::ooInetNoProxy>(
rSet, SID_INET_NOPROXY, batch);
352 new SfxEventAsyncer_Impl( rEventHint );
SfxApplication * SfxGetpApp()
IMPL_LINK(SfxEventAsyncer_Impl, IdleHdl, Timer *, pAsyncIdle, void)
static void GetOptions(SfxItemSet &)
void NotifyEvent(const SfxEventHint &rEvent, bool bSynchron=true)
static void SetOptions(const SfxItemSet &)
void Broadcast(const SfxHint &rHint)
SfxShell * GetShell(sal_uInt16 nIdx) const
Returns a pointer to the <SfxShell> which is at the position nIdx (from the top, last pushed is 0) on...
void Flush()
This method performs outstanding push- and pop- commands.
const OUString & GetEventName() const
SfxObjectShell * GetObjShell() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void DisableItem(sal_uInt16 nWhich)
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint)
SAL_DLLPRIVATE SfxObjectShell_Impl * Get_Impl()
The class SfxShell is the base class for all classes, which provide the functionality of the form <Sl...
void SetMaxUndoActionCount(size_t nMaxUndoActionCount)
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetNext(const SfxViewFrame &rPrev, const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
static bool IsQuickstarterInstalled()
static bool GetAutostart()
static void SetAutostart(bool bActivate)
static std::shared_ptr< ConfigurationChanges > create()
DECL_LINK(CheckNameHdl, SvxNameDialog &, bool)
#define LINK(Instance, Class, Member)
#define SAL_INFO_IF(condition, area, stream)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_INFO(area, stream)
bool IsReadOnly(EOption eOption)
void SetSecureURLs(std::vector< OUString > &&urlList)
std::vector< OUString > GetSecureURLs()