bump product version to 4.1.6.2
[LibreOffice.git] / vcl / inc / svdata.hxx
bloba929165901a68a42b7bdf445bc03bd76370e9bab
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef _SV_SVDATA_HXX
21 #define _SV_SVDATA_HXX
23 #include "sal/types.h"
25 #include <osl/thread.hxx>
26 #include <rtl/ref.hxx>
28 #include "tools/shl.hxx"
29 #include "tools/link.hxx"
30 #include "tools/fldunit.hxx"
31 #include "tools/string.hxx"
32 #include "tools/color.hxx"
33 #include "tools/debug.hxx"
35 #include "vcl/vclevent.hxx"
36 #include "tools/solar.h"
37 #include "vcl/svapp.hxx"
38 #include "vcl/dllapi.h"
40 #include "unotools/options.hxx"
42 #include "xconnection.hxx"
44 #include "com/sun/star/lang/XComponent.hpp"
45 #include "com/sun/star/uno/Reference.hxx"
47 #include <boost/unordered_map.hpp>
49 #include <config_version.h>
51 struct ImplTimerData;
52 struct ImplConfigData;
53 class ImplDirectFontSubstitution;
54 struct ImplHotKey;
55 struct ImplEventHook;
56 class Point;
57 class ResMgr;
58 class ImplAccelManager;
59 class ImplDevFontList;
60 class ImplFontCache;
61 class HelpTextWindow;
62 class ImplTBDragMgr;
63 class ImplIdleMgr;
64 class DbgWindow;
65 class FloatingWindow;
66 class AllSettings;
67 class KeyCode;
68 class NotifyEvent;
69 class Timer;
70 class AutoTimer;
71 class Help;
72 class ImageList;
73 class Image;
74 class PopupMenu;
75 class Application;
76 class OutputDevice;
77 class Window;
78 class SystemWindow;
79 class WorkWindow;
80 class Dialog;
81 class VirtualDevice;
82 class Printer;
83 class SalFrame;
84 class SalInstance;
85 class SalSystem;
86 class ImplPrnQueueList;
87 class UnoWrapperBase;
88 class GraphicConverter;
89 class ImplWheelWindow;
90 class SalTimer;
91 class SalI18NImeStatus;
92 class DockingManager;
93 class VclEventListeners2;
94 class SalData;
96 namespace vcl { class DisplayConnection; class SettingsConfigItem; class DeleteOnDeinitBase; }
97 namespace utl { class DefaultFontConfiguration; class FontSubstConfiguration; }
99 class LocaleConfigurationListener : public utl::ConfigurationListener
101 public:
102 virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 );
105 struct ImplSVAppData
107 enum ImeStatusWindowMode
109 ImeStatusWindowMode_UNKNOWN,
110 ImeStatusWindowMode_HIDE,
111 ImeStatusWindowMode_SHOW
114 AllSettings* mpSettings; // Application settings
115 LocaleConfigurationListener* mpCfgListener;
116 VclEventListeners* mpEventListeners; // listeners for vcl events (eg, extended toolkit)
117 VclEventListeners* mpKeyListeners; // listeners for key events only (eg, extended toolkit)
118 ImplAccelManager* mpAccelMgr; // Accelerator Manager
119 XubString* mpAppName; // Application name
120 XubString* mpAppFileName; // Abs. Application FileName
121 OUString* mpDisplayName; // Application Display Name
122 String* mpFontPath; // Additional Fontpath
123 Help* mpHelp; // Application help
124 PopupMenu* mpActivePopupMenu; // Actives Popup-Menu (in Execute)
125 ImplIdleMgr* mpIdleMgr; // Idle-Manager
126 ImplWheelWindow* mpWheelWindow; // WheelWindow
127 ImplHotKey* mpFirstHotKey; // HotKey-Verwaltung
128 ImplEventHook* mpFirstEventHook; // Event-Hooks
129 VclEventListeners2* mpPostYieldListeners; // post yield listeners
130 sal_uLong mnLastInputTime; // GetLastInputTime()
131 sal_uInt16 mnDispatchLevel; // DispatchLevel
132 sal_uInt16 mnModalMode; // ModalMode Count
133 sal_uInt16 mnModalDialog; // ModalDialog Count
134 sal_uInt16 mnAccessCount; // AccessHdl Count
135 sal_uInt16 mnSysWinMode; // Mode, when SystemWindows should be created
136 sal_uInt16 mnLayout; // --- RTL-Flags --- currently not used, only for testing
137 short mnDialogScaleX; // Scale X-Positions and sizes in Dialogs
138 sal_Bool mbInAppMain; // is Application::Main() on stack
139 sal_Bool mbInAppExecute; // is Application::Execute() on stack
140 sal_Bool mbAppQuit; // is Application::Quit() called
141 sal_Bool mbSettingsInit; // sal_True: Settings are initialized
142 sal_Bool mbNoYield; // Application::Yield will not wait for events if the queue is empty
143 // essentially that makes it the same as Application::Reschedule
144 Application::DialogCancelMode meDialogCancel; // sal_True: All Dialog::Execute() calls will be terminated immediately with return sal_False
145 long mnDefaultLayoutBorder; // default value in pixel for layout distances used
146 // in window arrangers
148 /** Controls whether showing any IME status window is toggled on or off.
150 Only meaningful if showing IME status windows can be toggled on and off
151 externally (see Application::CanToggleImeStatusWindow).
153 ImeStatusWindowMode meShowImeStatusWindow;
155 DECL_STATIC_LINK( ImplSVAppData, ImplQuitMsg, void* );
159 struct ImplSVGDIData
161 OutputDevice* mpFirstWinGraphics; // First OutputDevice with a Frame Graphics
162 OutputDevice* mpLastWinGraphics; // Last OutputDevice with a Frame Graphics
163 OutputDevice* mpFirstVirGraphics; // First OutputDevice with a VirtualDevice Graphics
164 OutputDevice* mpLastVirGraphics; // Last OutputDevice with a VirtualDevice Graphics
165 OutputDevice* mpFirstPrnGraphics; // First OutputDevice with a InfoPrinter Graphics
166 OutputDevice* mpLastPrnGraphics; // Last OutputDevice with a InfoPrinter Graphics
167 VirtualDevice* mpFirstVirDev; // First VirtualDevice
168 VirtualDevice* mpLastVirDev; // Last VirtualDevice
169 Printer* mpFirstPrinter; // First Printer
170 Printer* mpLastPrinter; // Last Printer
171 ImplPrnQueueList* mpPrinterQueueList; // List of all printer queue
172 ImplDevFontList* mpScreenFontList; // Screen-Font-List
173 ImplFontCache* mpScreenFontCache; // Screen-Font-Cache
174 ImplDirectFontSubstitution* mpDirectFontSubst;// Font-Substitutons defined in Tools->Options->Fonts
175 GraphicConverter* mpGrfConverter; // Converter for graphics
176 long mnRealAppFontX; // AppFont X-Numenator for 40/tel Width
177 long mnAppFontX; // AppFont X-Numenator for 40/tel Width + DialogScaleX
178 long mnAppFontY; // AppFont Y-Numenator for 80/tel Height
179 sal_Bool mbFontSubChanged; // sal_True: FontSubstitution was changed between Begin/End
180 utl::DefaultFontConfiguration* mpDefaultFontConfiguration;
181 utl::FontSubstConfiguration* mpFontSubstConfiguration;
182 bool mbNativeFontConfig; // true: do not override UI font
183 bool mbNoXORClipping; // true: do not use XOR to achieve clipping effects
187 struct ImplSVWinData
189 Window* mpFirstFrame; // First FrameWindow
190 Window* mpDefDialogParent; // Default Dialog Parent
191 WorkWindow* mpAppWin; // Application-Window
192 Window* mpFocusWin; // window, that has the focus
193 Window* mpActiveApplicationFrame; // the last active application frame, can be used as DefModalDialogParent if no focuswin set
194 Window* mpCaptureWin; // window, that has the mouse capture
195 Window* mpLastDeacWin; // Window, that need a deactivate (FloatingWindow-Handling)
196 DbgWindow* mpDbgWin; // debug window
197 FloatingWindow* mpFirstFloat; // First FloatingWindow in PopupMode
198 Dialog* mpLastExecuteDlg; // First Dialog that is in Execute
199 Window* mpExtTextInputWin; // Window, which is in ExtTextInput
200 Window* mpTrackWin; // window, that is in tracking mode
201 AutoTimer* mpTrackTimer; // tracking timer
202 ImageList* mpMsgBoxImgList; // ImageList for MessageBox
203 Window* mpAutoScrollWin; // window, that is in AutoScrollMode mode
204 sal_uInt16 mnTrackFlags; // tracking flags
205 sal_uInt16 mnAutoScrollFlags; // auto scroll flags
206 sal_Bool mbNoDeactivate; // sal_True: do not execute Deactivate
207 sal_Bool mbNoSaveFocus; // sal_True: menus must not save/restore focus
208 sal_Bool mbNoSaveBackground; // sal_True: save background is unnecessary or even less performant
212 typedef std::vector< std::pair< OUString, FieldUnit > > FieldUnitStringList;
214 struct ImplSVCtrlData
216 ImageList* mpCheckImgList; // ImageList for CheckBoxes
217 ImageList* mpRadioImgList; // ImageList for RadioButtons
218 ImageList* mpPinImgList; // ImageList for PIN
219 ImageList* mpSplitHPinImgList; // ImageList for Horizontale SplitWindows
220 ImageList* mpSplitVPinImgList; // ImageList for Vertikale SplitWindows (PIN's)
221 ImageList* mpSplitHArwImgList; // ImageList for Horizontale SplitWindows (Arrows)
222 ImageList* mpSplitVArwImgList; // ImageList for Vertikale SplitWindows (Arrows)
223 Image* mpDisclosurePlus;
224 Image* mpDisclosureMinus;
225 ImplTBDragMgr* mpTBDragMgr; // DragMgr for ToolBox
226 sal_uInt16 mnCheckStyle; // CheckBox-Style for ImageList-Update
227 sal_uInt16 mnRadioStyle; // Radio-Style for ImageList-Update
228 sal_uLong mnLastCheckFColor; // Letzte FaceColor fuer CheckImage
229 sal_uLong mnLastCheckWColor; // Letzte WindowColor fuer CheckImage
230 sal_uLong mnLastCheckWTextColor; // Letzte WindowTextColor fuer CheckImage
231 sal_uLong mnLastCheckLColor; // Letzte LightColor fuer CheckImage
232 sal_uLong mnLastRadioFColor; // Letzte FaceColor fuer RadioImage
233 sal_uLong mnLastRadioWColor; // Letzte WindowColor fuer RadioImage
234 sal_uLong mnLastRadioLColor; // Letzte LightColor fuer RadioImage
235 FieldUnitStringList* mpFieldUnitStrings; // list with field units
236 FieldUnitStringList* mpCleanUnitStrings; // same list but with some "fluff" like spaces removed
240 struct ImplSVHelpData
242 sal_Bool mbContextHelp : 1; // is ContextHelp enabled
243 sal_Bool mbExtHelp : 1; // is ExtendedHelp enabled
244 sal_Bool mbExtHelpMode : 1; // is in ExtendedHelp Mode
245 sal_Bool mbOldBalloonMode : 1; // BallonMode, befor ExtHelpMode started
246 sal_Bool mbBalloonHelp : 1; // is BalloonHelp enabled
247 sal_Bool mbQuickHelp : 1; // is QuickHelp enabled
248 sal_Bool mbSetKeyboardHelp : 1; // tiphelp was activated by keyboard
249 sal_Bool mbKeyboardHelp : 1; // tiphelp was activated by keyboard
250 sal_Bool mbAutoHelpId : 1; // generate HelpIds
251 sal_Bool mbRequestingHelp : 1; // In Window::RequestHelp
252 HelpTextWindow* mpHelpWin; // HelpWindow
253 sal_uLong mnLastHelpHideTime; // ticks of last show
256 struct ImplSVNWFData
258 int mnStatusBarLowerRightOffset; // amount in pixel to avoid in the lower righthand corner
259 int mnMenuFormatBorderX; // horizontal inner popup menu border
260 int mnMenuFormatBorderY; // vertical inner popup menu border
261 ::Color maMenuBarHighlightTextColor; // override higlight text color
262 // in menubar if not transparent
263 bool mbMenuBarDockingAreaCommonBG:1; // e.g. WinXP default theme
264 bool mbDockingAreaSeparateTB:1; // individual toolbar backgrounds
265 // instead of one for docking area
266 bool mbDockingAreaAvoidTBFrames:1; ///< don't draw frames around the individual toolbars if mbDockingAreaSeparateTB is false
267 bool mbToolboxDropDownSeparate:1; // two adjacent buttons for
268 // toolbox dropdown buttons
269 bool mbFlatMenu:1; // no popup 3D border
270 bool mbOpenMenuOnF10:1; // on gnome the first menu opens on F10
271 bool mbNoFocusRects:1; // on Aqua focus rects are not used
272 bool mbCenteredTabs:1; // on Aqua, tabs are centered
273 bool mbNoActiveTabTextRaise:1; // on Aqua the text for the selected tab
274 // should not "jump up" a pixel
275 bool mbProgressNeedsErase:1; // set true for platforms that should draw the
276 // window background before drawing the native
277 // progress bar
278 bool mbCheckBoxNeedsErase:1; // set true for platforms that should draw the
279 // window background before drawing the native
280 // checkbox
281 bool mbCanDrawWidgetAnySize:1; // set to true currently on gtk
283 /// entire drop down listbox resembles a button, no textarea/button parts (as currently on Windows)
284 bool mbDDListBoxNoTextArea:1;
287 struct BlendFrameCache
289 Size m_aLastSize;
290 sal_uInt8 m_nLastAlpha;
291 Color m_aLastColorTopLeft;
292 Color m_aLastColorTopRight;
293 Color m_aLastColorBottomRight;
294 Color m_aLastColorBottomLeft;
295 BitmapEx m_aLastResult;
297 BlendFrameCache()
298 : m_aLastSize(0, 0)
299 , m_nLastAlpha(0)
300 , m_aLastColorTopLeft(COL_BLACK)
301 , m_aLastColorTopRight(COL_BLACK)
302 , m_aLastColorBottomRight(COL_BLACK)
303 , m_aLastColorBottomLeft(COL_BLACK)
308 struct ImplSVData
310 SalData* mpSalData;
311 SalInstance* mpDefInst; // Default SalInstance
312 Application* mpApp; // pApp
313 WorkWindow* mpDefaultWin; // Default-Window
314 sal_Bool mbDeInit; // Is VCL deinitializing
315 sal_uLong mnThreadCount; // is VCL MultiThread enabled
316 ImplConfigData* mpFirstConfigData; // Zeiger auf ersten Config-Block
317 ImplTimerData* mpFirstTimerData; // list of all running timers
318 SalTimer* mpSalTimer; // interface to sal event loop/timers
319 SalI18NImeStatus* mpImeStatus; // interface to ime status window
320 SalSystem* mpSalSystem; // SalSystem interface
321 ResMgr* mpResMgr; // SV-Resource-Manager
322 sal_uLong mnTimerPeriod; // current timer period
323 sal_uLong mnTimerUpdate; // TimerCallbackProcs on stack
324 sal_Bool mbNotAllTimerCalled;// sal_True: Es muessen noch Timer abgearbeitet werden
325 sal_Bool mbNoCallTimer; // sal_True: No Timeout calls
326 ImplSVAppData maAppData; // indepen data for class Application
327 ImplSVGDIData maGDIData; // indepen data for Output classes
328 ImplSVWinData maWinData; // indepen data for Windows classes
329 ImplSVCtrlData maCtrlData; // indepen data for Control classes
330 ImplSVHelpData maHelpData; // indepen data for Help classes
331 ImplSVNWFData maNWFData;
332 UnoWrapperBase* mpUnoWrapper;
333 Window* mpIntroWindow; // the splash screen
334 DockingManager* mpDockingManager;
335 BlendFrameCache* mpBlendFrameCache;
336 sal_Bool mbIsTestTool;
338 oslThreadIdentifier mnMainThreadId;
339 rtl::Reference< vcl::DisplayConnection > mxDisplayConnection;
341 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > mxAccessBridge;
342 ::vcl::SettingsConfigItem* mpSettingsConfigItem;
343 std::list< vcl::DeleteOnDeinitBase* >* mpDeinitDeleteList;
344 boost::unordered_map< int, OUString >* mpPaperNames;
347 void ImplInitSVData();
348 void ImplDeInitSVData();
349 void ImplDestroySVData();
350 Window* ImplGetDefaultWindow();
351 VCL_PLUGIN_PUBLIC ResMgr* ImplGetResMgr();
352 VCL_PLUGIN_PUBLIC ResId VclResId( sal_Int32 nId ); // throws std::bad_alloc if no res mgr
353 DockingManager* ImplGetDockingManager();
354 BlendFrameCache* ImplGetBlendFrameCache();
355 void ImplWindowAutoMnemonic( Window* pWindow );
357 void ImplUpdateSystemProcessWindow();
358 Window* ImplFindWindow( const SalFrame* pFrame, Point& rSalFramePos );
360 bool ImplCallHotKey( const KeyCode& rKeyCode );
361 void ImplFreeHotKeyData();
362 void ImplFreeEventHookData();
364 long ImplCallPreNotify( NotifyEvent& rEvt );
365 long ImplCallEvent( NotifyEvent& rEvt );
367 extern VCL_PLUGIN_PUBLIC ImplSVData* pImplSVData;
368 inline VCL_PLUGIN_PUBLIC ImplSVData* ImplGetSVData() { return pImplSVData; }
369 VCL_PLUGIN_PUBLIC void ImplHideSplash();
371 bool ImplInitAccessBridge( bool bAllowCancel, bool &rCancelled );
373 FieldUnitStringList* ImplGetFieldUnits();
374 FieldUnitStringList* ImplGetCleanedFieldUnits();
377 inline const String& ImplGetSVEmptyStr()
378 { return String::EmptyString(); }
380 // ImplDelData is used as a "dog tag" by a window when it
381 // does something that could indirectly destroy the window
382 // TODO: wild destruction of a window should not be possible
384 struct ImplDelData
386 ImplDelData* mpNext;
387 const Window* mpWindow;
388 sal_Bool mbDel;
390 ImplDelData( const Window* pWindow = NULL )
391 : mpNext( NULL ), mpWindow( NULL ), mbDel( sal_False )
392 { if( pWindow ) AttachToWindow( pWindow ); }
394 virtual ~ImplDelData();
396 bool IsDead() const
398 DBG_ASSERT( mbDel == sal_False, "object deleted while in use !" );
399 return (mbDel!=sal_False);
402 private:
403 void AttachToWindow( const Window* );
406 struct ImplSVEvent
408 sal_uLong mnEvent;
409 void* mpData;
410 Link* mpLink;
411 Window* mpWindow;
412 ImplDelData maDelData;
413 sal_Bool mbCall;
416 #endif // _SV_SVDATA_HXX
418 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */