summaryrefslogtreecommitdiff
path: root/binfilter/inc/bf_sfx2/app.hxx
blob: 8f30f5b9412b961b6c4d043ff11187e301b19d52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * 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 .
 */
#ifndef _SFXAPP_HXX
#define _SFXAPP_HXX

#include <bf_svtools/bf_solar.h>

#ifndef TD_NEWDESKTOP
#define TF_NEWDESKTOP 1
#endif

#if _SOLAR__PRIVATE
#include <tools/time.hxx>
#include <vcl/timer.hxx>
#endif

#include <vcl/svapp.hxx>
#include <bf_svtools/smplhint.hxx>
#include <bf_svtools/poolitem.hxx>
#include <tools/errcode.hxx>
#include <tools/ref.hxx>
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/script/XLibraryContainer.hpp>

// whatwever will be today's name for explorer/frameset-docs
#define SFX_DESKTOP_HELPFILE_NAME "desktop"

#include <bf_sfx2/shell.hxx>
class ModalDialog;
class OutputDevice;
class KeyEvent;
class Point;
class Rectangle;
class Menu;
class Window;
class Config;
class INetURLObject;
class SimpleResMgr;
namespace binfilter {
class SvPseudoObject;
class SvStringsDtor;
class SvLinkSource;
class SvUShorts;
class SfxCancelManager;
class SfxHint;
class SfxItemSet;
class SfxEventConfigItem_Impl;

class StarBASIC;
class BasicManager;

#define PLUG_BROWSEHACK     42

#define SFX_DEMOKIND_FULL      1
#define SFX_DEMOKIND_COMPACT   2
#define SFX_DEMOKIND_TRYBUY    3
#define SFX_DEMOKIND_DEMO      4
#define SFX_DEMOKIND_INVALID   5
#define SFX_DEMOKIND_OLDTRYBUY 6
#define SFX_DEMOKIND_RUNTIME   7

enum SfxDBNameConvert {INI2NATIONAL, NATIONAL2INI };

#define SFX_BASICLIB_ADDMODE_NORMAL     0
#define SFX_BASICLIB_ADDMODE_REFERENCE  1
#define SFX_BASICLIB_ADDMODE_EXTERNAL   2

class GenLink;
class DropEvent;
class AppSettings;
class SfxAppData_Impl;
class SfxApplication;
class SfxBasicTestWin;
class SfxConfigManager;
class SfxEventConfiguration;
class SfxEventHint;
class SfxFilter;
class SfxInterface;
class SfxMacroConfig;
class SfxMedium;
class SfxObjectFactory;
class SfxObjectFactoryArr_Impl;
class SfxObjectShell;
class SfxObjectShellArr_Impl;
class SfxOptions;
class SfxProgress;
class SfxResourceManager;
class SfxShellObject;
class SfxSlot;
class SfxSlotPool;
class SvData;
class SfxFilterMatcher;
class SfxModule;
class SfxModuleArr_Impl;
class ISfxModule;
class SfxObjectShellLock;
class SfxMiscCfg;
struct SfxConstant;

#define STARAPP_VERB "STARAPP"
#define PRESENTATION_LIVEMODE       ((USHORT)0x1000)
#define DYNAMIC_USERID_OFFSET   1000

//--------------------------------------------------------------------


// class SfxLoadEnvironment ------------------------------------------

class LoadEnvironment_Impl;
class SfxLoadEnvironment : public SvRefBase
{
    LoadEnvironment_Impl* _pImpl;
public:
    SfxLoadEnvironment( LoadEnvironment_Impl* pImpl );
    ~SfxLoadEnvironment();
};

// class SfxSysChangeHint --------------------------------------------

class SfxSysChangeHint : public SfxHint
{
    USHORT              _nType;
    AppSettings&        _rAppSettings;
public:
                        TYPEINFO();
                        SfxSysChangeHint(USHORT nType, const AppSettings &rSet )
                        : _nType(nType), _rAppSettings((AppSettings&) rSet) {}
    USHORT              GetChangeType() const { return _nType; }
    const AppSettings&  GetAppSettings() const { return _rAppSettings; }
};

//--------------------------------------------------------------------

/*  [Beschreibung]

    Kurzschreibweise f"ur SfxGetpApp(). Liefert den Pointer auf die
    SfxApplication Instanz.
*/

#define SFX_APP() SfxGetpApp()

//====================================================================

#ifndef SFX_DECL_OBJECTSHELL_DEFINED
#define SFX_DECL_OBJECTSHELL_DEFINED
SV_DECL_REF(SfxObjectShell)
SV_DECL_LOCK(SfxObjectShell)
#endif

void RegisterServices();

struct SfxApplication_Impl;
class SfxApplication: public SfxShell

/*  [Beschreibung]

    Die Klasse SfxApplication bietet eine erweiterte Funktionalit"at
    der StarView-Klasse MDIApplication und mu?als Basisklasse f�r
    Applikationen, die das StarFramework verwenden wollen,
    eingesetzt werden.

    Sie bietet verschiedene Factories und Hooks in Form von
    virtuellen Methoden, um das default-Verhalten zu modifizieren.

    [Anmerkung]
    Von dieser Klasse mu?jede StarFramework-Applikation genau
    eine Instanz anlegen.
*/

{
    static SfxApplication*      pApp;
    struct SfxApplication_Impl* pImp;

    ULONG                       _nFeatures;
    SfxResourceManager*         pResMgr;
    SfxConfigManager*           pCfgMgr;        // bin"are Config, "ubergreifend
    SfxOptions*                 pOptions;
    SfxAppData_Impl*            pAppData_Impl;

    BOOL                        bInInit:1;    // TRUE solange in Initialisierung
    BOOL                        bInExit:1;    // TRUE solange in Deinit.
    BOOL                        bDowning:1;   // TRUE ab Exit und danach
    BOOL                        bCreatedExternal : 1;

    static SfxApplication*      Create();

protected:
    void                        SettingsChange( USHORT, const AppSettings & );

    virtual void                Init();
    virtual void                Exit();

    static void                 SetApp( SfxApplication *pDerived );

public:
                                TYPEINFO();

                                SfxApplication();
                                ~SfxApplication();

    virtual void                Main( );

    static SfxApplication*      GetOrCreate();
    void                        Quit();
    void                        InitLabelResMgr( const char* );
    void                        HandleAppEvent( const ApplicationEvent& rAppEvent );

    BOOL                        HasFeature( ULONG nFeature ) const;
    void                        SetFeatures( ULONG nFeatures )
                                {
                                    _nFeatures = nFeatures;
                                }

    String&                     GetSaveAsTargetURLHack();
    SfxFilterMatcher&           GetFilterMatcher();

    SfxResourceManager&         GetResourceManager() const
                                { return *pResMgr; }

    BasicManager*               GetBasicManager();
    StarBASIC*                  GetBasic();
    void                        EnterBasicCall();
    void                        LeaveBasicCall();
    SfxCancelManager*           GetCancelManager() const;

    BOOL                        IsInInit() const { return bInInit; }
    BOOL                        IsInExit() const { return bInExit; }
    BOOL                        IsDowning() const { return bDowning; }

    SfxMacroConfig*             GetMacroConfig() const;

    ResMgr*                     CreateResManager( const char *pPrefix );
    ResMgr*                     GetSfxResManager();

    const SfxFilter*            GetFilter(const SfxObjectFactory &rFact, const String &rFilterName) const;

    SfxProgress*                GetProgress() const;

    SfxOptions&                 GetOptions() { return *pOptions; }
    const USHORT*               GetOptionsRanges() const;
    const SfxOptions&           GetOptions() const { return *pOptions; }
    BOOL                        GetOptions(SfxItemSet &);
    void                        SetOptions(const SfxItemSet &);

    void                        ReleaseIndex(USHORT i);

    void                        NotifyEvent(const SfxEventHint& rEvent, bool bSynchron = TRUE );
    SfxEventConfiguration*      GetEventConfig() const;

    SfxMiscCfg*                 GetMiscConfig();
    void                        Deinitialize();

#if _SOLAR__PRIVATE
    SfxConfigManager*           GetConfigManager_Impl() const { return pCfgMgr; }
    USHORT                      ParseCommandLine_Impl();

    SfxObjectShellLock          NewDoc_Impl( const String& rFactory, const SfxItemSet* pSet = NULL );

    BOOL                        IsReadOnly_Impl(const String &rFile) const;
    bool                    Initialize_Impl();

    SfxAppData_Impl*            Get_Impl() const { return pAppData_Impl; }

    // Object-Factories
    SfxObjectShellArr_Impl&     GetObjectShells_Impl() const;
    const String&               GetLastDir_Impl() const;
    void                        SetLastDir_Impl( const String & );
    void                        SetLastFilter_Impl( const String & );
    void                        BuildBasicData_Impl();
    StarBASIC*                  GetBasic_Impl() const;

    bool                    IsInAsynchronCall_Impl() const;
    void                        Registrations_Impl();
    void                        InvalidateWinSlots_Impl();

    static SfxObjectShellLock   CreateObject_Impl( SfxMedium* pMedium, const String& rUrl );
    SfxEventConfigItem_Impl*    GetEventConfig_Impl();
#endif
};

//--------------------------------------------------------------------

inline SfxApplication* SfxGetpApp()
{
    return SfxApplication::GetOrCreate();
}

//--------------------------------------------------------------------

//! Dummies f"ur zu implementierende Items
#define SfxApplicationItem SfxVoidItem
#define SfxDocumentListItem SfxVoidItem

}//end of namespace binfilter
#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */