Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef FILEDLG2_HXX
21 : #define FILEDLG2_HXX
22 :
23 : #include <tools/fsys.hxx>
24 : #include <vcl/button.hxx>
25 : #include <vcl/unohelp.hxx>
26 : #include <vector>
27 :
28 : class FixedText;
29 : class Edit;
30 : class ListBox;
31 : class ListBox;
32 : class Button;
33 :
34 : class PathDialog;
35 : class ImpPathDialog;
36 :
37 : struct ImpFilterItem
38 : {
39 : String aName;
40 : String aMask;
41 :
42 : ImpFilterItem( const String & rFilter, const String & rMask )
43 : {
44 : aName = rFilter;
45 : aMask = rMask;
46 : }
47 : };
48 :
49 : typedef ::std::vector< ImpFilterItem* > ImpFilterList;
50 : #include <vcl/lstbox.hxx>
51 :
52 0 : class KbdListBox : public ListBox
53 : {
54 : public:
55 :
56 0 : KbdListBox( Window* pParent, WinBits nStyle = WB_BORDER )
57 0 : : ListBox ( pParent, nStyle )
58 0 : {};
59 :
60 : virtual long PreNotify( NotifyEvent& rNEvt );
61 :
62 : };
63 :
64 :
65 : class ImpPathDialog
66 : {
67 : private:
68 : PathDialog* pSvPathDialog;
69 : Edit* pEdit;
70 : FixedText* pDirTitel;
71 : KbdListBox* pDirList;
72 : FixedText* pDirPath;
73 : ListBox* pDriveList;
74 : FixedText* pDriveTitle;
75 : PushButton* pLoadBtn;
76 : PushButton* pOkBtn;
77 : PushButton* pCancelBtn;
78 : PushButton* pHomeBtn;
79 : PushButton* pNewDirBtn;
80 :
81 : sal_uInt16 nOwnChildren;
82 :
83 : DirEntry aPath; // aktuell angewaehlter Pfad
84 : sal_uInt16 nDirCount; // Anzahl der Verzeichnis-
85 : // Verschachtelungen
86 : protected:
87 :
88 : virtual void UpdateEntries( const sal_Bool bWithDirs );
89 : void UpdateDirs( const DirEntry& rTmpPath );
90 :
91 : sal_Bool IsFileOk( const DirEntry& rDirEntry );
92 : void InitControls();
93 :
94 : DECL_LINK( SelectHdl, ListBox * );
95 : DECL_LINK( DblClickHdl, ListBox * );
96 : DECL_LINK( ClickHdl, Button * );
97 :
98 : public:
99 : ImpPathDialog( PathDialog* pDlg, RESOURCE_TYPE nType, sal_Bool bCreateDir );
100 : virtual ~ImpPathDialog();
101 :
102 : virtual void SetPath( const String& rPath );
103 : virtual String GetPath() const;
104 :
105 : virtual void PreExecute();
106 : virtual void PostExecute();
107 :
108 0 : PathDialog* GetPathDialog() const { return pSvPathDialog; }
109 :
110 : void SetOkButtonText( const String& rText ) { pOkBtn->SetText( rText ); }
111 : void SetCancelButtonText( const String& rText ) { pCancelBtn->SetText( rText ); }
112 :
113 : };
114 :
115 : class ImpSvFileDlg
116 : {
117 : private:
118 : ImpPathDialog* pDlg;
119 :
120 : public:
121 0 : ImpSvFileDlg() { pDlg = 0; }
122 0 : ~ImpSvFileDlg() { delete pDlg; }
123 :
124 0 : ImpPathDialog* GetDialog() const { return pDlg; }
125 : void CreatePathDialog(PathDialog* pCreateFrom, bool bCreate);
126 :
127 : void SetOkButtonText( const String& rText ) { pDlg->SetOkButtonText( rText ); } // ihr habts ja nicht anders gewollt
128 : void SetCancelButtonText( const String& rText ) { pDlg->SetCancelButtonText( rText ); }
129 :
130 : };
131 :
132 : #endif // FILEDLG2_HXX
133 :
134 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|