update dev300-m58
[ooovba.git] / svtools / inc / filedlg.hxx
blobd2795da982ba65e2f90c3ad0ab4f4628c51c9ee5
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: filedlg.hxx,v $
10 * $Revision: 1.5 $
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"
36 #ifndef _DIALOG_HXX
37 #include <vcl/dialog.hxx>
38 #endif
40 class Edit;
41 class ImpSvFileDlg;
43 // --------------
44 // - SvPathDialog -
45 // --------------
47 class SVT_DLLPUBLIC PathDialog : public ModalDialog
49 private:
50 friend class FileDialog; // Imp...
52 ImpSvFileDlg* pImpFileDlg; // Implementation
53 Link aOKHdlLink; // Link zum OK-Handler
55 protected:
56 UniString aDfltExt; // Default - Extension
58 public:
59 PathDialog( Window* pParent, WinBits nWinStyle = 0, BOOL bCreateDir = TRUE );
60 ~PathDialog();
62 virtual long OK();
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();
74 // --------------
75 // - SvFileDialog -
76 // --------------
78 class SVT_DLLPUBLIC FileDialog : public PathDialog
80 private:
81 Link aFileHdlLink; // Link zum FileSelect-Handler
82 Link aFilterHdlLink; // Link zum FilterSelect-Handler
84 public:
85 FileDialog( Window* pParent, WinBits nWinStyle );
86 ~FileDialog();
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