Files
libreoffice/desktop/inc/app.hxx

203 lines
7.7 KiB
C++
Raw Normal View History

2010-10-27 13:11:31 +01:00
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
re-base on ALv2 code. Includes: Patch contributed by: Jurgen Schmidt remove onlineregistration with dependencies http://svn.apache.org/viewvc?view=revision&revision=1240245 imported patch package_eventlistener.patch http://svn.apache.org/viewvc?view=revision&revision=1172103 Patch contributed by Pedro Giffuni Accept Google Chrome OS fonts as equivalent to MS fonts. http://svn.apache.org/viewvc?view=revision&revision=1233155 http://svn.apache.org/viewvc?view=revision&revision=1233408 Patch contributed by Andre Fischer Do not add targets for junit tests when junit is disabled. http://svn.apache.org/viewvc?view=revision&revision=1241508 Patches contributed by Mathias Bauer (and others) gnumake4 work variously http://svn.apache.org/viewvc?view=revision&revision=1394707 http://svn.apache.org/viewvc?view=revision&revision=1394326 cws mba34issues01: #i114600#: remove forbidden characters from list of unencoded characters http://svn.apache.org/viewvc?view=revision&revision=1172370 Patches contributed by Oliver Rainer-Wittman some clean up in JPEGReader due to memory constraints http://svn.apache.org/viewvc?view=revision&revision=1299729 119114 - method <UpdateDialog::addSpecificError(..)> - create entry with correct type http://svn.apache.org/viewvc?view=revision&revision=1305265 Patches contributed by Ariel Constenla-Haile i118707 - make toolbar control's popup window grab focus http://svn.apache.org/viewvc?view=revision&revision=1225846 Patches contributed by Herbert Duerr #i118662# remove usage of BerkeleyDB in desktop module http://svn.apache.org/viewvc?view=revision&revision=1213171 minor cleanups in dp_persmap.* http://svn.apache.org/viewvc?view=revision&revision=1215064 flush early to prevent problem with extension manager not cleaning up its objects http://svn.apache.org/viewvc?view=revision&revision=1228147 i118726 do not flush *pmap file while reading it http://svn.apache.org/viewvc?view=revision&revision=1230614 #i119048# migrate BDB extension entries using a simple heuristic http://svn.apache.org/viewvc?view=revision&revision=1300972 #i119048# handle edge cases when importing BDB hash files http://svn.apache.org/viewvc?view=revision&revision=1301428 #i119113# fix of-by-one when importing BDB files http://svn.apache.org/viewvc?view=revision&revision=1305420 restore our encryption settings, icon themes, and dictionaries. removed wrapper hacks, kill obsolete bundled extension blob / pre-registration handling, remove duplicated quickstart code. remove OS/2 conditionals.
2012-11-15 17:28:16 +00:00
/*
* 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/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
2000-09-18 15:18:56 +00:00
#ifndef INCLUDED_DESKTOP_INC_APP_HXX
#define INCLUDED_DESKTOP_INC_APP_HXX
#include <boost/optional.hpp>
#include <boost/scoped_ptr.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <sal/log.hxx>
2001-07-16 11:55:47 +00:00
#include <vcl/svapp.hxx>
#include <vcl/timer.hxx>
2001-07-16 11:55:47 +00:00
#include <tools/resmgr.hxx>
#include <unotools/bootstrap.hxx>
#include <com/sun/star/task/XStatusIndicator.hpp>
#include <com/sun/star/uno/Reference.h>
#include <osl/mutex.hxx>
namespace com { namespace sun { namespace star { namespace uno {
class XComponentContext;
} } } }
namespace desktop
{
2000-09-18 15:18:56 +00:00
/*--------------------------------------------------------------------
2001-07-16 11:55:47 +00:00
Description: Application-class
2000-09-18 15:18:56 +00:00
--------------------------------------------------------------------*/
class CommandLineArgs;
2002-11-06 13:32:44 +00:00
class Lockfile;
struct ConvertData;
class Desktop : public Application
2000-09-18 15:18:56 +00:00
{
2011-03-13 16:07:53 -05:00
int doShutdown();
2001-07-16 11:55:47 +00:00
public:
enum BootstrapError
{
BE_OK,
BE_UNO_SERVICEMANAGER,
BE_UNO_SERVICE_CONFIG_MISSING,
BE_PATHINFO_MISSING,
BE_USERINSTALL_FAILED,
BE_LANGUAGE_MISSING,
BE_USERINSTALL_NOTENOUGHDISKSPACE,
BE_USERINSTALL_NOWRITEACCESS,
BE_OFFICECONFIG_BROKEN
};
enum BootstrapStatus
{
BS_OK,
BS_TERMINATE
};
Desktop();
virtual ~Desktop();
virtual int Main( ) SAL_OVERRIDE;
virtual void Init() SAL_OVERRIDE;
virtual void InitFinished() SAL_OVERRIDE;
virtual void DeInit() SAL_OVERRIDE;
virtual bool QueryExit() SAL_OVERRIDE;
virtual sal_uInt16 Exception(sal_uInt16 nError) SAL_OVERRIDE;
virtual void OverrideSystemSettings( AllSettings& rSettings ) SAL_OVERRIDE;
virtual void AppEvent( const ApplicationEvent& rAppEvent ) SAL_OVERRIDE;
2001-07-16 11:55:47 +00:00
DECL_LINK( OpenClients_Impl, void* );
2001-07-06 14:58:45 +00:00
static void OpenClients();
static void OpenDefault();
DECL_STATIC_LINK( Desktop, EnableAcceptors_Impl, void*);
static void HandleAppEvent( const ApplicationEvent& rAppEvent );
static ResMgr* GetDesktopResManager();
static CommandLineArgs& GetCommandLineArgs();
2001-07-06 14:58:45 +00:00
static void HandleBootstrapErrors(
BootstrapError nError, OUString const & aMessage );
void SetBootstrapError(
BootstrapError nError, OUString const & aMessage )
{
if ( m_aBootstrapError == BE_OK )
{
SAL_INFO("desktop.app", "SetBootstrapError: " << nError << " '" << aMessage << "'");
m_aBootstrapError = nError;
m_aBootstrapErrorMessage = aMessage;
}
}
void SetBootstrapStatus( BootstrapStatus nStatus )
{
m_aBootstrapStatus = nStatus;
}
BootstrapStatus GetBootstrapStatus() const
{
return m_aBootstrapStatus;
}
static bool isCrashReporterEnabled();
// first-start (ever) related methods
static bool CheckExtensionDependencies();
void SynchronizeExtensionRepositories();
void SetSplashScreenText( const OUString& rText );
void SetSplashScreenProgress( sal_Int32 );
// Bootstrap methods
static void InitApplicationServiceManager();
// throws an exception upon failure
private:
void RegisterServices(
css::uno::Reference< css::uno::XComponentContext > const & context);
static void DeregisterServices();
static void CreateTemporaryDirectory();
static void RemoveTemporaryDirectory();
bool InitializeInstallation( const OUString& rAppFilename );
static bool InitializeConfiguration();
static void FlushConfiguration();
static bool InitializeQuickstartMode( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
static void HandleBootstrapPathErrors( ::utl::Bootstrap::Status, const OUString& aMsg );
void StartSetup( const OUString& aParameters );
// Create a error message depending on bootstrap failure code and an optional file url
static OUString CreateErrorMsgString( utl::Bootstrap::FailureCode nFailureCode,
const OUString& aFileURL );
static void PreloadModuleData( const CommandLineArgs& );
static void PreloadConfigurationData();
css::uno::Reference<css::task::XStatusIndicator> m_rSplashScreen;
void OpenSplashScreen();
void CloseSplashScreen();
DECL_STATIC_LINK( Desktop, ImplInitFilterHdl, ConvertData* );
DECL_STATIC_LINK_TYPED( Desktop, AsyncInitFirstRun, Timer*, void );
/** checks if the office is run the first time
<p>If so, <method>DoFirstRunInitializations</method> is called (asynchronously and delayed) and the
respective flag in the configuration is reset.</p>
*/
void CheckFirstRun( );
/// does initializations which are necessary for the first run of the office
static void DoFirstRunInitializations();
static void ShowBackingComponent(Desktop * progress);
static bool SaveTasks();
static bool isUIOnSessionShutdownAllowed();
// on-demand acceptors
static void createAcceptor(const OUString& aDescription);
static void enableAcceptors();
static void destroyAcceptor(const OUString& aDescription);
bool m_bCleanedExtensionCache;
bool m_bServicesRegistered;
BootstrapError m_aBootstrapError;
OUString m_aBootstrapErrorMessage;
BootstrapStatus m_aBootstrapStatus;
2001-07-16 11:55:47 +00:00
boost::scoped_ptr<Lockfile> m_xLockfile;
Timer m_firstRunTimer;
2002-11-06 13:32:44 +00:00
static ResMgr* pResMgr;
2000-09-18 15:18:56 +00:00
};
OUString GetURL_Impl(
const OUString& rName, boost::optional< OUString > const & cwdUrl );
OUString ReplaceStringHookProc(const OUString& rStr);
}
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined LIBO_HEADLESS
bool fire_glxtest_process();
#endif
#endif // INCLUDED_DESKTOP_INC_APP_HXX
2010-10-27 13:11:31 +01:00
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */