Impress Remote 1.0.5, tag sdremote-1.0.5
[LibreOffice.git] / vcl / unx / kde / fpicker / kdefilepicker.hxx
blob2e4166742268f0f5cdabdea0b9603ef9d94402ab
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 _KDEFILEPICKER_HXX_
21 #define _KDEFILEPICKER_HXX_
23 #ifdef ENABLE_TDE
24 #include <shell/tde_defines.h>
25 #endif // ENABLE_TDE
27 #include <cstddef>
29 #include <kfiledialog.h>
30 #include <kfilefiltercombo.h>
32 class QGrid;
33 class QHBox;
34 class QVBox;
36 class KDEFileDialog : public KFileDialog
38 #ifdef ENABLE_TDE
39 TQ_OBJECT
40 #else // ENABLE_TDE
41 Q_OBJECT
42 #endif // ENABLE_TDE
44 protected:
45 typedef QPair< QString, QString > FilterEntry;
46 typedef QValueList< FilterEntry > FilterList;
48 QVBox *m_pCustomWidget;
49 QHBox *m_pCombosAndButtons;
51 QVBox *m_pLabels;
52 QVBox *m_pComboBoxes;
53 QVBox *m_pPushButtons;
55 QGrid *m_pCheckBoxes;
57 FilterList m_aFilters;
59 /** Are we a "Save As" dialog?
61 * We cannot use KFileDialog::setOperationMode() here, because then
62 * it automatically adds an "Automatically select filename extension"
63 * check box, and completely destroys the dialog's layout
64 * (custom list boxes are under this check box, which looks ugly).
66 bool m_bIsSave;
67 bool m_bIsExecuting;
69 bool m_bCanNotifySelection;
71 public:
72 KDEFileDialog( const QString &startDir, const QString &filter,
73 QWidget *parent, const char *name );
74 virtual ~KDEFileDialog();
76 protected:
77 virtual void resizeEvent( QResizeEvent *pEvent );
78 virtual void showEvent( QShowEvent *pEvent );
79 void updateCustomWidgetLayout();
81 virtual void customEvent( QCustomEvent *pEvent );
83 protected:
84 void appendControl( const QString &rId, const QString &rType, const QString &rTitle );
85 QWidget* findControl( const QString &rId ) const;
86 void enableControl( const QString &rId, const QString &rValue );
87 void getValue( const QString &rId, const QString &rAction );
88 void setValue( const QString &rId, const QString &rAction, const QStringList &rValue );
90 void appendFilter( const QString &rTitle, const QString &rFilter );
91 QString filters() const;
92 QString addExtension( const QString &rFileName ) const;
94 void setIsSave( bool bIsSave ) { m_bIsSave = bIsSave; }
95 bool isSave( void ) const { return m_bIsSave; }
97 void setIsExecuting( bool bIsExecuting ) { m_bIsExecuting = bIsExecuting; }
98 bool isExecuting( void ) const { return m_bIsExecuting; }
100 bool isSupportedProtocol( const QString &rProtocol ) const;
101 KURL mostLocalURL( const KURL &rURL ) const;
102 QString localCopy( const QString &rFileName ) const;
104 void setCanNotifySelection( bool bCanNotifySelection ) { m_bCanNotifySelection = bCanNotifySelection; }
105 bool canNotifySelection( void ) const { return m_bCanNotifySelection; }
107 protected slots:
108 // Qt3 moc does not really understand #ifdef and would process both slots,
109 // so the FILTER_OUT_FOO tags are used to remove some slots before moc sees them.
110 #ifdef ENABLE_TDE
111 void fileHighlightedCommand( const TQString & ); // FILTER_OUT_TDE
112 #else // ENABLE_TDE
113 void fileHighlightedCommand( const QString & ); // FILTER_OUT_KDE
114 #endif // ENABLE_TDE
115 void selectionChangedCommand();
117 protected:
118 void sendCommand( const QString &rCommand );
119 void appendURL( QString &rBuffer, const KURL &rURL );
120 void appendEscaped( QString &rBuffer, const QString &rString );
121 QString escapeString( const QString &rString );
124 class KDEFileFilterComboHack : public KFileFilterCombo
126 public:
127 void setCurrentFilter( const QString& filter );
130 #endif // _KDEFILEPICKER_HXX_
132 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */