1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 INCLUDED_VCL_UNX_KDE_FPICKER_KDEFILEPICKER_HXX
21 #define INCLUDED_VCL_UNX_KDE_FPICKER_KDEFILEPICKER_HXX
23 #include <sal/config.h>
25 #include <config_vclplug.h>
26 #include <sal/types.h>
29 #include <shell/tde_defines.h>
35 #include <tdefiledialog.h>
36 #include <tdefilefiltercombo.h>
38 #include <kfiledialog.h>
39 #include <kfilefiltercombo.h>
46 class KDEFileDialog
: public KFileDialog
55 typedef QPair
< QString
, QString
> FilterEntry
;
56 typedef QValueList
< FilterEntry
> FilterList
;
58 QVBox
*m_pCustomWidget
;
59 QHBox
*m_pCombosAndButtons
;
63 QVBox
*m_pPushButtons
;
67 FilterList m_aFilters
;
69 /** Are we a "Save As" dialog?
71 * We cannot use KFileDialog::setOperationMode() here, because then
72 * it automatically adds an "Automatically select filename extension"
73 * check box, and completely destroys the dialog's layout
74 * (custom list boxes are under this check box, which looks ugly).
79 bool m_bCanNotifySelection
;
82 KDEFileDialog( const QString
&startDir
, const QString
&filter
,
83 QWidget
*parent
, const char *name
);
84 virtual ~KDEFileDialog();
87 virtual void resizeEvent( QResizeEvent
*pEvent
) SAL_OVERRIDE
;
88 virtual void showEvent( QShowEvent
*pEvent
) SAL_OVERRIDE
;
89 void updateCustomWidgetLayout();
91 virtual void customEvent( QCustomEvent
*pEvent
) SAL_OVERRIDE
;
94 void appendControl( const QString
&rId
, const QString
&rType
, const QString
&rTitle
);
95 QWidget
* findControl( const QString
&rId
) const;
96 void enableControl( const QString
&rId
, const QString
&rValue
);
97 void getValue( const QString
&rId
, const QString
&rAction
);
98 void setValue( const QString
&rId
, const QString
&rAction
, const QStringList
&rValue
);
100 void appendFilter( const QString
&rTitle
, const QString
&rFilter
);
101 QString
filters() const;
102 QString
addExtension( const QString
&rFileName
) const;
104 void setIsSave( bool bIsSave
) { m_bIsSave
= bIsSave
; }
105 bool isSave( void ) const { return m_bIsSave
; }
107 void setIsExecuting( bool bIsExecuting
) { m_bIsExecuting
= bIsExecuting
; }
108 bool isExecuting( void ) const { return m_bIsExecuting
; }
110 bool isSupportedProtocol( const QString
&rProtocol
) const;
111 KURL
mostLocalURL( const KURL
&rURL
) const;
112 QString
localCopy( const QString
&rFileName
) const;
114 void setCanNotifySelection( bool bCanNotifySelection
) { m_bCanNotifySelection
= bCanNotifySelection
; }
115 bool canNotifySelection( void ) const { return m_bCanNotifySelection
; }
118 // Qt3 moc does not really understand #ifdef and would process both slots,
119 // so the FILTER_OUT_FOO tags are used to remove some slots before moc sees them.
121 void fileHighlightedCommand( const TQString
& ); // FILTER_OUT_TDE
123 void fileHighlightedCommand( const QString
& ); // FILTER_OUT_KDE
125 void selectionChangedCommand();
128 void sendCommand( const QString
&rCommand
);
129 void appendURL( QString
&rBuffer
, const KURL
&rURL
);
130 void appendEscaped( QString
&rBuffer
, const QString
&rString
);
131 QString
escapeString( const QString
&rString
);
134 class KDEFileFilterComboHack
: public KFileFilterCombo
137 void setCurrentFilter( const QString
& filter
);
140 #endif // INCLUDED_VCL_UNX_KDE_FPICKER_KDEFILEPICKER_HXX
142 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */