Impress Remote 1.0.5, tag sdremote-1.0.5
[LibreOffice.git] / vcl / unx / kde / fpicker / kdecommandthread.hxx
blob70c790af92c141a1d678e762e2fc35989f8402dc
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 _KDECOMMANDTHREAD_HXX_
21 #define _KDECOMMANDTHREAD_HXX_
23 #ifdef ENABLE_TDE
24 #include <shell/tde_defines.h>
25 #endif // ENABLE_TDE
27 #ifdef ENABLE_TDE
28 #include <tqevent.h>
29 #include <tqmutex.h>
30 #include <tqthread.h>
31 #else // ENABLE_TDE
32 #include <qevent.h>
33 #include <qmutex.h>
34 #include <qthread.h>
35 #endif // ENABLE_TDE
37 class KDECommandEvent : public QCustomEvent
39 public:
40 enum CommandEventType {
41 Unknown = 0,
43 AppendControl,
44 EnableControl,
45 GetValue,
46 SetValue,
48 AppendFilter,
49 AppendFilterGroup,
50 UpdateFilters,
51 GetCurrentFilter,
52 SetCurrentFilter,
54 GetDirectory,
55 SetDirectory,
57 GetFiles,
59 SetTitle,
60 SetType,
61 SetDefaultName,
62 SetMultiSelection,
64 Exec
66 static const QEvent::Type TypeId = (QEvent::Type) ( (int) QEvent::User + 42 /*random magic value*/ );
68 protected:
69 CommandEventType m_eCommand;
71 public:
72 KDECommandEvent( const QString &qCommand, QStringList *pStringList );
74 CommandEventType command() const { return m_eCommand; }
75 QStringList* stringList() { return static_cast< QStringList* >( data() ); }
78 class KDECommandThread : public QThread
80 protected:
81 QObject *m_pObject;
83 QMutex m_aMutex;
85 public:
86 KDECommandThread( QWidget *pObject );
87 virtual ~KDECommandThread();
89 virtual void run();
91 protected:
92 void handleCommand( const QString &rString, bool &bQuit );
93 QStringList* tokenize( const QString &rString );
96 #endif // _KDECOMMANDTHREAD_HXX_
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */