Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef FILEDLG2_HXX
30 : : #define FILEDLG2_HXX
31 : :
32 : : #include <tools/fsys.hxx>
33 : : #include <vcl/button.hxx>
34 : : #include <vcl/unohelp.hxx>
35 : : #include <vector>
36 : :
37 : : class FixedText;
38 : : class Edit;
39 : : class ListBox;
40 : : class ListBox;
41 : : class Button;
42 : :
43 : : class PathDialog;
44 : : class ImpPathDialog;
45 : :
46 : : struct ImpFilterItem
47 : : {
48 : : String aName;
49 : : String aMask;
50 : :
51 : : ImpFilterItem( const String & rFilter, const String & rMask )
52 : : {
53 : : aName = rFilter;
54 : : aMask = rMask;
55 : : }
56 : : };
57 : :
58 : : typedef ::std::vector< ImpFilterItem* > ImpFilterList;
59 : : #include <vcl/lstbox.hxx>
60 : :
61 [ # # ]: 0 : class KbdListBox : public ListBox
62 : : {
63 : : public:
64 : :
65 : 0 : KbdListBox( Window* pParent, WinBits nStyle = WB_BORDER )
66 : 0 : : ListBox ( pParent, nStyle )
67 : 0 : {};
68 : :
69 : : virtual long PreNotify( NotifyEvent& rNEvt );
70 : :
71 : : };
72 : :
73 : :
74 : : class ImpPathDialog
75 : : {
76 : : private:
77 : : PathDialog* pSvPathDialog;
78 : : Edit* pEdit;
79 : : FixedText* pDirTitel;
80 : : KbdListBox* pDirList;
81 : : FixedText* pDirPath;
82 : : ListBox* pDriveList;
83 : : FixedText* pDriveTitle;
84 : : PushButton* pLoadBtn;
85 : : PushButton* pOkBtn;
86 : : PushButton* pCancelBtn;
87 : : PushButton* pHomeBtn;
88 : : PushButton* pNewDirBtn;
89 : :
90 : : sal_uInt16 nOwnChildren;
91 : :
92 : : DirEntry aPath; // aktuell angewaehlter Pfad
93 : : sal_uInt16 nDirCount; // Anzahl der Verzeichnis-
94 : : // Verschachtelungen
95 : : protected:
96 : :
97 : : virtual void UpdateEntries( const sal_Bool bWithDirs );
98 : : void UpdateDirs( const DirEntry& rTmpPath );
99 : :
100 : : sal_Bool IsFileOk( const DirEntry& rDirEntry );
101 : : void InitControls();
102 : :
103 : : DECL_LINK( SelectHdl, ListBox * );
104 : : DECL_LINK( DblClickHdl, ListBox * );
105 : : DECL_LINK( ClickHdl, Button * );
106 : :
107 : : public:
108 : : ImpPathDialog( PathDialog* pDlg, RESOURCE_TYPE nType, sal_Bool bCreateDir );
109 : : virtual ~ImpPathDialog();
110 : :
111 : : virtual void SetPath( const String& rPath );
112 : : virtual String GetPath() const;
113 : :
114 : : virtual void PreExecute();
115 : : virtual void PostExecute();
116 : :
117 : 0 : PathDialog* GetPathDialog() const { return pSvPathDialog; }
118 : :
119 : : void SetOkButtonText( const String& rText ) { pOkBtn->SetText( rText ); }
120 : : void SetCancelButtonText( const String& rText ) { pCancelBtn->SetText( rText ); }
121 : :
122 : : };
123 : :
124 : : class ImpSvFileDlg
125 : : {
126 : : private:
127 : : ImpPathDialog* pDlg;
128 : :
129 : : public:
130 : 0 : ImpSvFileDlg() { pDlg = 0; }
131 [ # # ]: 0 : ~ImpSvFileDlg() { delete pDlg; }
132 : :
133 : 0 : ImpPathDialog* GetDialog() const { return pDlg; }
134 : : void CreatePathDialog(PathDialog* pCreateFrom, bool bCreate);
135 : :
136 : : void SetOkButtonText( const String& rText ) { pDlg->SetOkButtonText( rText ); } // ihr habts ja nicht anders gewollt
137 : : void SetCancelButtonText( const String& rText ) { pDlg->SetCancelButtonText( rText ); }
138 : :
139 : : };
140 : :
141 : : #endif // FILEDLG2_HXX
142 : :
143 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|