1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: filedlg.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SVT_FILEDLG_HXX
32 #define _SVT_FILEDLG_HXX
34 #include "svtools/svtdllapi.h"
37 #include <vcl/dialog.hxx>
47 class SVT_DLLPUBLIC PathDialog
: public ModalDialog
50 friend class FileDialog
; // Imp...
52 ImpSvFileDlg
* pImpFileDlg
; // Implementation
53 Link aOKHdlLink
; // Link zum OK-Handler
56 UniString aDfltExt
; // Default - Extension
59 PathDialog( Window
* pParent
, WinBits nWinStyle
= 0, BOOL bCreateDir
= TRUE
);
64 void SetPath( const UniString
& rNewPath
);
65 void SetPath( const Edit
& rEdit
);
66 UniString
GetPath() const;
68 void SetOKHdl( const Link
& rLink
) { aOKHdlLink
= rLink
; }
69 const Link
& GetOKHdl() const { return aOKHdlLink
; }
71 virtual short Execute();
78 class SVT_DLLPUBLIC FileDialog
: public PathDialog
81 Link aFileHdlLink
; // Link zum FileSelect-Handler
82 Link aFilterHdlLink
; // Link zum FilterSelect-Handler
85 FileDialog( Window
* pParent
, WinBits nWinStyle
);
88 virtual void FileSelect();
89 virtual void FilterSelect();
91 void SetDefaultExt( const UniString
& rExt
) { aDfltExt
= rExt
; }
92 const UniString
& GetDefaultExt() const { return aDfltExt
; }
93 void AddFilter( const UniString
& rFilter
, const UniString
& rType
);
94 void RemoveFilter( const UniString
& rFilter
);
95 void RemoveAllFilter();
96 void SetCurFilter( const UniString
& rFilter
);
97 UniString
GetCurFilter() const;
98 USHORT
GetFilterCount() const;
99 UniString
GetFilterName( USHORT nPos
) const;
100 UniString
GetFilterType( USHORT nPos
) const;
102 void SetFileSelectHdl( const Link
& rLink
) { aFileHdlLink
= rLink
; }
103 const Link
& GetFileSelectHdl() const { return aFileHdlLink
; }
104 void SetFilterSelectHdl( const Link
& rLink
) { aFilterHdlLink
= rLink
; }
105 const Link
& GetFilterSelectHdl() const { return aFilterHdlLink
; }
107 void SetOkButtonText( const UniString
& rText
);
108 void SetCancelButtonText( const UniString
& rText
);
111 #endif // _FILEDLG_HXX