Version 4.3.0.0.beta1, tag libreoffice-4.3.0.0.beta1
[LibreOffice.git] / vcl / unx / kde4 / KDEXLib.hxx
blob1f2a2dd1f43664dfad9d20434bfbc971782fe14e
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 #pragma once
22 #include <unx/saldisp.hxx>
24 #include <fixx11h.h>
26 #include <qhash.h>
27 #include <qsocketnotifier.h>
28 #include <qtimer.h>
30 #include <unx/salinst.h>
32 class VCLKDEApplication;
34 class KDEXLib : public QObject, public SalXLib
36 Q_OBJECT
37 private:
38 bool m_bStartupDone;
39 VCLKDEApplication* m_pApplication;
40 char** m_pFreeCmdLineArgs;
41 char** m_pAppCmdLineArgs;
42 int m_nFakeCmdLineArgs;
43 struct SocketData
45 void* data;
46 YieldFunc pending;
47 YieldFunc queued;
48 YieldFunc handle;
49 QSocketNotifier* notifier;
51 QHash< int, SocketData > socketData; // key is fd
52 QTimer timeoutTimer;
53 QTimer userEventTimer;
54 int m_frameWidth;
55 bool m_isGlibEventLoopType;
56 bool m_allowKdeDialogs;
58 private:
59 void setupEventLoop();
61 private Q_SLOTS:
62 void socketNotifierActivated( int fd );
63 void timeoutActivated();
64 void userEventActivated();
65 void startTimeoutTimer();
66 void startUserEventTimer();
67 void processYield( bool bWait, bool bHandleAllCurrentEvents );
68 Q_SIGNALS:
69 void startTimeoutTimerSignal();
70 void startUserEventTimerSignal();
71 void processYieldSignal( bool bWait, bool bHandleAllCurrentEvents );
72 com::sun::star::uno::Reference< com::sun::star::ui::dialogs::XFilePicker2 >
73 createFilePickerSignal( const com::sun::star::uno::Reference<
74 com::sun::star::uno::XComponentContext >& );
75 int getFrameWidthSignal();
77 public:
78 KDEXLib();
79 virtual ~KDEXLib();
81 virtual void Init() SAL_OVERRIDE;
82 virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ) SAL_OVERRIDE;
83 virtual void Insert( int fd, void* data, YieldFunc pending, YieldFunc queued, YieldFunc handle ) SAL_OVERRIDE;
84 virtual void Remove( int fd ) SAL_OVERRIDE;
85 virtual void StartTimer( sal_uLong nMS ) SAL_OVERRIDE;
86 virtual void StopTimer() SAL_OVERRIDE;
87 virtual void Wakeup() SAL_OVERRIDE;
88 virtual void PostUserEvent() SAL_OVERRIDE;
90 void doStartup();
91 bool allowKdeDialogs() { return m_allowKdeDialogs; }
93 public Q_SLOTS:
94 com::sun::star::uno::Reference< com::sun::star::ui::dialogs::XFilePicker2 >
95 createFilePicker( const com::sun::star::uno::Reference<
96 com::sun::star::uno::XComponentContext >& );
97 int getFrameWidth();
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */